公众号:阿区先生

Git提交规范

2020-12-24  本文已影响0人  雄关漫道从头越

Git提交规范
Git Hook - 实现commit-msg自动装饰

格式:

<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

type [必须]

用于说明 commit 的类别,只允许使用下面几种标识:

scope [必须]

用于说明修改的范围,基本上有有以下几种情形:

subject [必须]

用于表示本次提交修改的简要说明,尽量简短

ISSUE_ID [可选]

添加在 git issues 中需求或者 bug 修复对应的 issues 记录ID

body [可选]

body中就是 subject的详细说明

footer [可选]

可以写备注,填写相关的需求管理 issues id

commit-msg hook

如何保证每一次commit-msg信息格式的准备,可以是使用commit-msg hook

hook规则文件模板

上一篇 下一篇

猜你喜欢

热点阅读