Hooks are ran as part of a git command (like before a commit). Checkout .git/hooks for a list of hooks.
.git/hooks
Pre-commit hooks run prior to $ git commit.
$ git commit
See pre-commit for a cool python pre-commit tool.