git commit msg规范

Jiaqi.zhang 于 2022-09-03 发布

在使用 Git 工具时,每次提交都需要补充commit message。commit message 应该清晰明,说明本次提交的目的。目前主流选择为Angular 规范。IDEA 也有基于该规范的插件(git-commit-template)来协助我们配置commit message。

git commit message格式:

<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>

消息头:

type: type 用于说明 commit 的类别,只允许使用下面7个标识。

scope: scope 用于说明 commit 影响的范围,比如数据层、控制层、视图层等等,视项目不同而不同。如果没有合适的scope,可以使用“ * ”代替。

subject: subject 是 commit 目的的简短描述,不超过50个字符。

消息体:

消息尾:

例子:

docs(guide): updated fixed docs from Google Docs

Couple of typos fixed:
- indentation
- batchLogbatchLog -> batchLog
- start periodic checking
- missing brace
feat($browser): onUrlChange event (popstate/hashchange/polling)

Added new event to $browser:
- forward popstate event if available
- forward hashchange event if popstate not available
- do polling when neither popstate nor hashchange available

Breaks $browser.onHashChange, which was removed (use onUrlChange instead)
fix($compile): couple of unit tests for IE9

Older IEs serialize html uppercased, but IE9 does not...
Would be better to expect case insensitive, unfortunately jasmine does
not allow to user regexps for throw expectations.

Closes #392
Breaks foo.bar api, foo.baz should be used instead

参考

AngularJS Git Commit Message Conventions

Commit message 和 Change log 编写指南