This repository allows you to use global hooks without overriding local ones.
- It uses the classic
global hooks
strategy by setting a global git configuration to change the place git will look for hooks. - It installs
forwarding global hooks
that will by default just triggerproject local hooks
considering the project you run a git command on (usinggit rev-parse
). - It installs a forwarding global hook for all existing kind of hooks: see the documentation:
- applypatch-msg
- commit-msg
- fsmonitor-watchman
- post-update
- pre-applypatch
- pre-commit
- pre-merge-commit
- pre-push
- pre-rebase
- pre-receive
- prepare-commit-msg
- push-to-checkout
- run-local-hook
- update
- In conclusion, to install this should not affect the way your current hooks are triggered. You can then update any default
forwarding global hook
to have aglobal hook
running on all your projects, without overriding local ones that will be called afterward.
The global hooks will be installed in $HOME/.git-global.hooks
.
sh install.sh
The code is released under the AGPLv3. If subdirectories include a different license, that license applies instead.