Unset Git Hookspath
- One minute read - 98 wordsI had a nice Git commit hook running in my project, then one day, it stopped working. What happened?
What happened was I installed Husky to manage my hooks. It was an experiment I didn’t stick with. In the process, it unknowingly set a custom Git hookspath
:
$ git config core.hookspath
core.hookspath=.husky/_
With this set, Git looks in .husky/
for my hooks, and not in .git/
. Once I figured this out, I was able to get my hook back with unset
.
$ git config --unset core.hooksPath
The solution I found is common enough that Husky has documented it.