
Why your husky hooks are not working
Husky is a great tool for adding git
commit hooks, it is so useful when you need to check the commit message or run a series of linter/formatter etc. during git commit
.
Today I was going to setup a new repo, but the husky
hooks are not working at all. I spent half an hour to finally figure out the problem:
After installing
husky
, it runs a script to patch the.git
folder (i.e..git/hooks
) to actually add hooks togit commit
. It does nothing if your.git
folder is not present. Therefore:Make sure you have initialized
git
first, before installinghusky
.