0%

Git commit message specification

Git commit message specification

https://www.conventionalcommits.org/en/v1.0.0/

https://www.ruanyifeng.com/blog/2016/01/commit_message_change_log.html

Specification

1
2
3
4
5
<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Types:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
abaliable types:
[
'build',
'chore',
'ci',
'docs',
'feat',
'fix',
'perf',
'refactor',
'revert',
'style',
'test'
];

description:
feat:新功能(feature)
fix:修补bug
docs:文档(documentation)
style: 格式(不影响代码运行的变动)
refactor:重构(即不是新增功能,也不是修改bug的代码变动)
test:增加测试
chore:构建过程或辅助工具的变动

Examples

1
2
3
feat: allow provided config object to extend other configs

BREAKING CHANGE: `extends` key in config file is now used for extending other config files

Commit message with ! to draw attention to breaking change

1
feat!: send an email to the customer when a product is shipped

Commit message with scope and ! to draw attention to breaking change

1
feat(api)!: send an email to the customer when a product is shipped
1
2
3
chore!: drop support for Node 6

BREAKING CHANGE: use JavaScript features not available in Node 6.

Commit message with no body

1
docs: correct spelling of CHANGELOG

Commit message with scope

1
feat(lang): add Polish language

Commit message with multi-paragraph body and multiple footers

1
2
3
4
5
6
7
8
9
10
fix: prevent racing of requests

Introduce a request id and a reference to latest request. Dismiss
incoming responses other than from latest request.

Remove timeouts which were used to mitigate the racing issue but are
obsolete now.

Reviewed-by: Z
Refs: #123

Others

idea plugins: git commit template

hangelog generate & commit message validate