最近开发vue项目,遇到了git提交失败,根据错误提示,成功解救了问题
a.错误提示: running pre-commit hook:lint-staged b.错误分析 有一个钩子,提交前检查项目代码的规范,eslint的检查,提交失败的原因:项目中error过多,导致检测未通过,提交失败。 c.解决思路 (1).不进行检查 删掉pre-commit hook,具体在项目文件夹.git\hooks目录下,找到文件pre-commit (2).再次提交 d.第二种解决思路 在配置文件中,不需要使用eslint时,把lintOnSave设为false即可 e.清空git 缓存 git rm -r --cached git add . git commit -m "update"