I am trying to point my repositories gitconfig to my local git hooks directory so that every developer on my team can download this directory and not have to worry about updating the default hooks everytime they clone a repo.
I've created a local repo under $HOME/.githooks
which includes a simple commit-msg
hook.
Then in my code repository $HOME/development/repo
, I attempt to update the .gitconfig
to point to my local hooks: git config --local core.hooksPath $HOME/.githooks
Everything works fine if I update the hooks in the code repository, but not when I try to repoint it. I've read the docs which state that by default the hooks directory is $GIT_DIR/hooks
, but that can be changed via the core.hooksPath
configuration variable -- so I belive this is possible.
https://git-scm.com/docs/githooks/2.9.0
I've read a number of posts and the only consistent suggestion I've seen is to verify that the hook is executable, which I've done.
What may I be doing wrong, any advice is appreciated.