Blame view

hg-monitor-web-base/src/main/resources/static/commit.md 1.51 KB
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51
##  commit message

格式约定:`<type>(<scope>): <subject>`  (注意冒号后面有空格)

**scope 可选,写不写都可**

### type

`type` 用于说明 commit 的类别

- **feat / feature**:新增功能
- **fix / fixes / fixed / hotfix**:(热)修复 Bug(s)
- **docs**:修改文档
- **style**:仅仅修改了代码样式(空格、缩进)等,不改变代码逻辑
- **refactor**:代码重构,未新增任何功能和修复任何 Bug
- **perf**: 改善性能和用户体验
- **resolve / resolves / resolved**: 修复代码合并冲突
- **test**:测试用例的修改
- **chore**:构建过程或辅助工具的变动(新增依赖库、工具配置等)
- **revert**: 回滚版本
- **ci**: 自动化流程配置修改
- **release**: 版本发布
- **close / closes / closed**: 关闭 issue(s)

如果 `type` 为 `feat` 和 `fix`,则该 commit 将肯定出现在 Change log 之中。

### scope(可选)

`scope` 用于说明本次提交所影响的功能模块,视项目的不同而不同。

必须将内容包含在 `()` 里,里面的模块以 `,` 隔开,最后一项没有逗号。

### subject

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

- 以动词开头,使用第一人称现在时,比如 change,而不是 changed 或 changes
- 第一个字母小写
- 结尾不加句号(.)

### 示例

``` bash
~ git commit -m "feat: add a new feature"
```
``` bash
~ git commit -m "fix(nav): 更正参数拼写错误"
```
``` bash
~ git commit -m "docs: update README.md"
```