Git Hooks provides a simple mechanism to manage hooks for several Git repositories in a unified and simple way. It allows you to install hook scripts in a central location and use them for your Git repositories.
in a new directory (preferably, tho you may also run it from the source directory). Then, use
to install git-hooks. This will install git-hooks to
/usr/local. You can
use ccmake to change the installation prefix. Below, we will assume that you installed
To setup a repository using git-hooks, just use the repository template that ships with git-hooks.
This will setup the new repository
myrepo.git with git-hooks. Check the
sample config file that will be created for
To migrate an existing repository to use git-hooks, you should first backup
your existing hook scripts. Then replace the hooks with the ones from
/usr/local/share/git-hooks/template/hooks. Afterwards, you should migrate
your previous hook scripts to global hook scripts used by git-hooks.
The git-hooks package includes several useful hooks, which can be configured
to your needs using git config settings in your repository (or even global
/usr/local/share/git-hooks/template/config file provides a sample
Please see the hook scripts in
/usr/local/share/git-hooks/*.d/ for the
various supported config settings.