Suddenly I am getting the "husky > pre-commit hook failed (add --no-verify to bypass)" error message when I give the git commit
.
I don't know what I am doing wrong. I tried git clean
command too. Anyone faced similar issue?
Husky can prevent you from bad git commit
, git push
and more. If you are getting this error check your code syntax. In case you are getting this error even if your code is valid, please use the below solution.
Delete the .git/hooks
folder and then do the npm install
for reinstall husky. There are chances for conflicts with husky-generated files and .git/hooks/ files
.
this is a temporary/quick solution.
git commit -m "message" --no-verify
The Comment by @Elio is a much preferred solution, as --no-verify
is skipping whatever scripts that should run.
I assume here that if the scripts are there it is for a reason...
Therefore:
You can also delete the .git/hook folder and then uninstall and reinstall husky. There are some conflicts with husky generated files and .git/hook/ files. That worked for me
In my case, the uninstall/re-install was not necessary.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With