我在 CLI 中输入这个
git commit -m "Hello World!"
Run Code Online (Sandbox Code Playgroud)
这是我收到的错误消息
husky > commit-msg (node v14.15.3)
? input: Hello World!
? subject may not be empty [subject-empty]
? type may not be empty [type-empty]
? found 2 problems, 0 warnings
? Get help: https://github.com/conventional-changelog/commitlint/#what-is-commitlint
husky > commit-msg hook failed (add --no-verify to bypass)
Run Code Online (Sandbox Code Playgroud)
这是什么意思?
use*_*491 84
要修复该错误,请更改提交消息(“Hello world”)以遵循常规提交格式,例如“feat:hello world”。
正如“获取帮助”消息链接(在错误消息中)所解释的那样,husky 调用commitlint来验证您的提交消息是否符合此格式。
我们应该始终使用RTFEM!
GoT*_*oTo 25
对我来说这是一个空间。改变了
`feat(pill):message here`
Run Code Online (Sandbox Code Playgroud)
到
`feat(pill): message here`
Run Code Online (Sandbox Code Playgroud)
有一个名为 husky 的包,它为您的提交消息定义了特定的模板。如果不满足模板,就会出现奇怪的错误。
Ash*_*wat 25
您可以尝试的另一个解决方案是
git commit --no-verify -m "Hello World!"
git commit -n -m "Hello World!"
参考
Ben*_*lan 16
我用“npm uninstall husky”解决了这个问题
编辑:在删除它之前,请确保您知道它的作用并且您的项目不会使用它。
| 归档时间: |
|
| 查看次数: |
838 次 |
| 最近记录: |