跳至主要內容

Git commit 规范

望间软件Git小于 1 分钟

Git commit 规范

Header 分为三个部分 type、scope、summary,其中 type 和 summary 为必填项,scope 可以省略

<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 必须精简

上次编辑于:
贡献者: ViewRoom