目录

Git Commit Message 规范

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

[optional body]

[optional footer(s)]
 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
# head: <type>(<scope>): <subject>
# - type: feat, fix, docs, style, refactor, test, chore
# - scope: can be empty (eg. if the change is a global or difficult to assign to a single component)
# - subject: start with verb (such as 'change'), 50-character line
#
# body: 72-character wrapped. This should answer:
# * Why was this change necessary?
# * How does it address the problem?
# * Are there any side effects?
#
# footer: 
# - Include a link to the ticket, if any.
# - BREAKING CHANGE
#

type: commit 的类别

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

scope: commit 影响的范围

subject: commit 目的的简短描述

Body : 对本次 commit 的详细描述