Copy from https://ruby-china.org/topics/15737
[type]: [subject]<body><footer>
其中,Header 是必需的,Body 和 Footer 可以省略。
Header
Header 部分只有一行,包括三个字段:type(必需)、scope(可选)和 subject(必需)。
type 用于说明 commit 的类别,只允许使用下面 7 个标识。
- feat 新功能(feature)
- fix 修补 bug
- docs 文档(documentation)
- style 格式(不影响代码运行的变动)
- refactor 重构(即不是新增功能,也不是修改 bug 的代码变动)
- test 增加测试
- chore 构建过程、辅助工具的变动
- perf 提高性能
如果 type 为 feat 和 fix,则该 commit 将肯定出现在 Change log 之中。
scope 用于说明 commit 影响的范围,比如数据层、控制层、视图层等等,视项目不同而不同。
subject** 是 commit 目的的简短描述,不超过 50 个字符。
- 以动词开头,使用第一人称现在时,比如 change,而不是 changed 或 changes
- 第一个字母大写
- 结尾不加句号
Body
Body 部分是对本次 commit 的详细描述,可以分成多行。下面是一个范例。 ``` More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. Further paragraphs come after blank lines. - Bullet points are okay, too
Use a hanging indent
应该说明代码变动的动机,以及与以前行为的对比,参考前文提到的 **注释要回答如下信息**。<a name="Footer"></a>### FooterFooter 部分只用于不兼容变动和关闭 Issue。
BREAKING CHANGE: isolate scope bindings definition has changed. To migrate the code follow the example below: Before: scope: {
myAttr: 'attribute',} After: scope: {
myAttr: '@',} The removed
injectwasn’t generaly useful for directives so there should be no code using it. Closes #123, #245, #992 ```GitHub Flow
参考
https://blog.amowu.com/devops-continuous-integration-delivery-docker-circleci-aws-beanstalk/
