Git commit 规范
建议大家按照此规范编写 Git commit message。
- 标题使用祈使语气;
- 标题开头添加 commit type,并以一个空格分隔;
- 标题不要使用句号结尾;
- 标题不超过 70 个字符;
- 用一空行分隔标题与正文;
- 正文解释 why & what,而不是 how;
- 正文在 70 个字符处换行;
- 如果 commit 的内容比较多,建议分拆成多个 commit;
- 删除 Changes to be committed: 以其下面的 #;
- 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 | add 添加博客发布脚本 |