husky > pre-commit hook failed (add --no-verify to bypass)

Sathia picture Sathia · Sep 17, 2020 · Viewed 27.9k times · Source

Suddenly I am getting the "husky > pre-commit hook failed (add --no-verify to bypass)" error message when I give the git commit.

enter image description here

I don't know what I am doing wrong. I tried git clean command too.

Answer

Sathia picture Sathia · Sep 18, 2020

Husky can prevent you from bad git commit, git push and more. If you are getting this error check your code syntax, in case if you are getting this error even your code is valid. Please use the below command.

git commit -m "message" --no-verify

Another solution is to delete the .git/hook folder and then uninstall and reinstall husky. There are chances for conflicts with husky-generated files and .git/hook/ files.