怎么写一个好的 Git commit message

网络上很多关于 commit message 的想法都来源于 tpope,在他看来,一个好的 Git commit messge 应该是这样的:

Capitalized, short (50 chars or less) summary

More detailed explanatory text, if necessary. Wrap it to about 72
characters or so. In some contexts, the first line is treated as the
subject of an email and the rest of the text as the body. The blank
line separating the summary from the body is critical (unless you omit
the body entirely); tools like rebase can get confused if you run the
two together.

如上:

  • 首先是一个不超过 50 个字符的摘要(summary),单独占一行,首字母大写,行尾不要加点 .
  • 如果有必要进行进一步解释,那么在摘要行下面空一行,添加描述信息。描述信息每行不超过 72 个字符。

commit message 应该使用祈使语气,也就是 “Fix bug”,而不是 “Fixed bug” 或者 “Fixes bug”。这是为了与 git

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值