Image for post
Image for post

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 to git commit. It does nothing if your .git folder is not present. Therefore:

Make sure you have initialized git first, before installing husky.

A JavaScript/Node/Flutter developer who love technical stuffs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store