git commit -m "XX" being given pre -commit hook failed (add --no-verify to bypass) problem

In sync local files to online repository when

报错 pre -commit hook failed (add --no-verify to bypass)

When you enter git commit -m "xxx" in the end, submitting code,
pre-the commit (client) hook, it will make the code run type style check before submitting information in Git.
If the code does not comply with the appropriate rules, error.

Although you are prompted to add --no-verify, enter git commit -m "xxx" --no-verify to bypass authentication, mandatory submission. But not necessarily successfully submitted.

Simple and crude solution:

Violence in the pre-commit hook removed.

Specific steps:
1. Go to the project's .git folder (the folder hidden by default, can be set to display the command ls or find)
2. re-entering the hooks folder
3. Delete the pre-commit file
4. Re-git commit -m "xxx "git push to

To sum it up: Submit file deletion .git the rule: rm -rf ./git/hooks/pre-commit

Last advice: This is the last resort. If daily development, still have to write the code of norms, now code is usually carried out ESLint check, if that trouble, you can install a plug-Prettier, to help you format the code.

Guess you like

Origin www.cnblogs.com/wangtong111/p/11813370.html