例如注释有这样的(转载)
一般情况下,提交 GIT 时的注释可以分成几类,可以用几个动词开始:
尽量将注释缩减为一句话,不要包含详细的内容。
假如有 Issues 系统,其中可以包含 Issue 的 ID。比如:Issue #123456
包含作者的信息。比如 by Bruce
完整例子:
git commit -m 'Issue #[issue number] by [username]: [Short summary of the change].'
Related articles
大家的注释方式规范如何?
Copyright 2014-2026 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
Mod: remove unused code, 表示修改(Modify)Add: a new module to have faster process, 表示新增(Add)Rem: deprecate unused modules, 表示移除(Remove)Ref: improved the implementation of module X, 表示重构(Refactory)有同学要问了:如果一个commit里的内容无法用上述任意一种语句陈述,应该怎么办?
同学,那说明你的commit应该被拆分成多个小部分
当然我最喜欢的commit message还是第一个commit,内容是
First Blood推荐这篇文章 写好你的 Commit Message