git config --global init.templatedir '~/.git-templates'- so git will copy all templates into new or cloned repositorymkdir -p ~/.git-templates/hookstouch ~/.git-templates/hooks/pre-commitchmod +x ~/.git-templates/hooks/pre-commit- Update
~/.git-templates/hooks/pre-commitwith the following content
BRANCH="$(git rev-parse --abbrev-ref HEAD)"
MASTER_CHECK_ENABLED="$(git config --get custom.hooks.mastercheck || echo 'true')"