格式:
<type>(<scope>): <subject> [<ISSUE_ID>]
<body>
<footer>
例子:
feat(user): Add user registration [777]
Use Tencent cloud verification code to verify mobile phone
and add user registration function
https://github.com/one-user/a-project/issues/777
用于说明 commit 的类别,只允许使用下面几种标识:
feat
:新功能(feature)fix
:修补bugdocs
:文档(documentation)style
: 格式(不影响代码运行的变动)refactor
:重构(即不是新增功能,也不是修改bug的代码变动)perf
:优化test
:增加测试chore
:构建过程或辅助工具的变动revert
:撤销上一次的 commit用于说明修改的范围,基本上有有以下几种情形:
all
:表示大范围的修改loation
:表示小范围的修改module
:表示修改了某个模块 例如:feat(user): add user login
用于表示本次提交修改的简要说明,尽量简短
添加在 git issues 中需求或者 bug 修复对应的 issues 记录ID
body
中就是 subject
的详细说明
可以写备注,填写相关的需求管理 issues id
如何保证每一次commit-msg信息格式的准备,可以是使用commit-msg hook