个人技术学习

取是能力,舍是境界


  • 首页

  • 关于

  • 排行榜

  • 标签

  • 分类

  • 归档

  • 读书

  • 电影

  • 搜索

团队开发中的 Git commit 规范

发表于 2017-06-30 分类于 Git Hot: ℃
本文字数: 448 阅读时长 ≈ 1 分钟

Git commit 规范

建议大家按照此规范编写 Git commit message。

  1. 标题使用祈使语气;
  2. 标题开头添加 commit type,并以一个空格分隔;
  3. 标题不要使用句号结尾;
  4. 标题不超过 70 个字符;
  5. 用一空行分隔标题与正文;
  6. 正文解释 why & what,而不是 how;
  7. 正文在 70 个字符处换行;
  8. 如果 commit 的内容比较多,建议分拆成多个 commit;
  9. 删除 Changes to be committed: 以其下面的 #;
  10. commit Type:
    • add ( 添加功能或文件 )
    • del ( 删除功能或文件 )
    • mod ( 修改功能或文件 )
    • fix ( 修复 bug [PS: 修复 bug 的描述中包含 Issue 的 ID,如:Issue #269] )
    • refactor ( 重构 )
    • performance ( 提升性能、优化 )
    • dependency ( 升级依赖项,如 .net 平台的 nuget 包,node 的 node_modules 等 )
    • docs ( 修改文档 )

规范的 git commit message:

1
2
3
4
5
6
7
8
9
10
11
add 添加博客发布脚本
Changes to be committed:
new file: deploy.sh

mod 修改分数人数分布图批次线样式
Changes to be committed:
modified: Web/Views/Innovate/Index.cshtml

fix 修复数说报考迁徙图不分文理科
Changes to be committed:
modified: Web/Controllers/InnovateController.cs

参考文章

oschinaGit 提交的正确姿势:Commit message 编写指南
  • 本文作者: Vito
  • 本文链接: https://alienwow.cc/posts/2017/06/git-commit-standard/
  • 版权声明: 本博客所有文章除特别声明外,均采用 BY-NC-SA 许可协议。转载请注明出处!
# Git
理解 Git 分支管理最佳实践
ASP.Net Mvc OutputCache 服务器端缓存清理
  • 文章目录
  • 站点概览
Vito

Vito

取是能力,舍是境界
14 日志
10 分类
31 标签
GitHub WTM E-Mail
  1. 1. Git commit 规范
  2. 2. 参考文章
京ICP备16041040号-1 © 2016 – 2023 Vito | 站点总字数: 8k | 站点阅读时长 ≈ 8 分钟
由 Hexo 强力驱动 v3.9.0
|
主题 – NexT.Mist v7.3.0
| 友情链接: 卡拉云后台系统
|