首页 > 解决方案 > 尝试提交时出现奇怪的错误。[主题为空]

问题描述

我在 CLI 中输入这个

git commit -m "Hello World!"

这是我收到的错误消息

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)

这是什么意思?

标签: husky

解决方案


要修复错误,请将您的提交消息(“Hello world”)更改为遵循常规提交格式,例如“feat: hello world”。

正如“获取帮助”消息链接(在您的错误消息中)所解释的那样,husky 调用 commitlint 来验证您的提交消息是否符合此格式。

我们应该永远RTFEM


推荐阅读