For some reference material check out:
http://book.git-scm.com/5_git_hooks.html http://progit.org/book/ch7-3.html
http://mark-story.com/posts/view/using-git-commit-hooks-to-prevent-stupid-mistakes https://github.com/ReekenX/git-php-syntax-checker
For some reference material check out:
And a couple simple examples: