Commit规范
Git commit 规范
Header 分为三个部分 type、scope、summary,其中 type 和 summary 为必填项,scope 可以省略
1 | <type>(<scope>): <summary> |
Type
用于说明 git commit 的类别,只允许使用下面的标识
- feat: 新功能(feature)
- fix: 修复 bug
- docs: 文档(documentation)
- style: 格式(不影响代码运行的变动)
- refactor: 重构(即不是新增功能,也不是修改 bug 的代码变动)
- perf: 优化相关
- test: 增加测试
- chore: 构建过程或辅助工具的变动
- revert: 回滚到上一个版本
Scope
Scope 用于说明 commit 影响的范围
Summary
Summary 是对 commit 的一个简短的描述,一般 Git Commit Head 总共不超过 50 个字符,所以 summary 必须精简
-
感谢你赐予我前进的力量
赞赏者名单
因为你们的支持让我意识到写文章的价值🙏
本文是原创文章,采用 CC BY-NC-ND 4.0 协议,完整转载请注明来自 View Room
评论