- Git hooks are scripts that Git executes before or after events such as: commit, push, and receive.
- By default the hooks directory is
.git/hooks
, but that can be changed via the core.hooksPath
configuration variable.
- Any scripting language that can be run as an executable can be used to make hooks.
- Hooks are local to any given Git repository, and they are not copied over to the new repository when
git clone
is run.
- Some of the hooks are: – pre-commit – post-commit – post-checkout – pre-push – update