0

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.

Peter
  • 11
  • 4
  • What version of Git are you using? – bk2204 Nov 02 '18 at 00:39
  • @brianm.carlson git 2.16.3. I read a couple of articles that suggested versions 2.9+ will support this, but I haven't had luck linking to a different directory. – Peter Nov 05 '18 at 14:01

1 Answers1

0

Very strange. I was having issues with git 2.16 and then I figured to update it to 2.19 and it seems to work well.

I'm able to get it to work with both the local and global setting, regardless of where the hook directory is (as advertised).

Peter
  • 11
  • 4