A library of git hooks that you may find useful.
All scripts use POSIX Shell (aka. /bin/sh
) to maximise portability.
Each directory contains a set of different hooks you can use. The name of the directory is the name of the hook, the name of the file describes what that particular hook does.
- Choose a hook you wish to use.
- Install the hook to
.git/hooks/<name>
where<name>
is the name of the direcctory the hook script came from.
If you wish to use multiple scripts for the same hook, you will want to create a custom hook that calls each of the selected scripts in turn.
Validates that the commit message is "well-formed", according to the official git guidelines.
Some of the rules this hook enforces are best-effort, for example ensuring that the summary is in the imperative tense.
All violations are gathered during validation, and a failure will print a list of all problems.