近期在使用 ant design pro v5时,在vscode里用git commit时会报错,具体错误如下:
> running commit-msg hook: fabric verify-commit
ERROR invalid commit message format.
Proper commit message format is required for automated changelog generation. Examples:
💥 feat(compiler): add 'comments' option
🐛 fix(compiler): fix some bug
📝 docs(compiler): add some docs
🌷 UI(compiler): better styles
🏰 chore(compiler): Made some changes to the scaffolding
🌐 locale(compiler): Made a small contribution to internationalization
See .github/commit-convention.md for more details.
commit-msg hook failed (add --no-verify to bypass)
主要是因为git提交时标题不规范所致。研究了许久,主要有三种解决办法:
1、直接忽略
git commit -a -m '提交语' --no-verify
2、删除package.json下的gitHooks
将package.json下的 “gitHooks”: { “commit-msg”: “fabric verify-commit” }删除。
3、规范做法
3.1 自己按规范写标题
💥 feat(compiler): add 'comments' option
🐛 fix(compiler): fix some bug
📝 docs(compiler): add some docs
🌷 UI(compiler): better styles
🏰 chore(compiler): Made some changes to the scaffolding
🌐 locale(compiler): Made a small contribution to internationalization
最简形式:
docs(compiler): 提交语
3.2 懒人模式
借助vscode插件:git-commit-plugin 安装成功后,要提交时,在点击红色按钮就可以调 选择需要的功能 填写Scope和Subject 其他按需要填,之后点Complete。 之后提交就可以。
|