IDEA的git提交代码提交失败,有错误0 个文件已提交,1 个文件提交失败:
IDEA的git提交代码提交失败,有错误0 个文件已提交,1 个文件提交失败: JFZX_YFZCB-1362 电量单位改为mA husky > pre-commit (node v14.18.0) [33m[33m⚠[33m Some of your tasks use `git add` command. Please remove it from the config since all modifications made by tasks will be automatically add
解决办法:
在终端运行:npm uninstall husky --save
Husky 钩子验证失败
Husky 是一个 Git 钩子工具,常用于在提交代码前执行自动化检查(如代码格式化、测试等)。如果钩子脚本执行失败(例如 ESLint 检查不通过),Git 提交会被终止。
运行npm uninstall husky --save
会删除 Husky 并从package.json
中移除依赖,会临时绕过验证机制