[linux小水滴]git commit message注意事项

commit message注意事项

举例:

一个好的commit message应该是下面这样1

Summarize changes in around 50 characters or less

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 the commit 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); various tools like `log`, `shortlog`
and `rebase` can get confused if you run the two together.

Explain the problem that this commit is solving. Focus on why you
are making this change as opposed to how (the code explains that).
Are there side effects or other unintuitive consequences of this
change? Here's the place to explain them.

Further paragraphs come after blank lines.

 - Bullet points are okay, too

 - Typically a hyphen or asterisk is used for the bullet, preceded
   by a single space, with blank lines in between, but conventions
   vary here

If you use an issue tracker, put references to them at the bottom,
like this:

Resolves: #123
See also: #456, #789

六条注意事项:

  1. 第一行为主题行,一句简要总结,与正文用空行隔

  2. 主题行建议字数50字以内,最多72个字
    可以利用vim来实现72字符自动换行,只需要在~/.vimrc中添加下面这一行2
    autocmd Filetype gitcommit setlocal spell textwidth=72

  3. 主题行首字母大写,不要句号结尾

  4. 主题行用祈使句

  5. 正文每行不得超过72个字符

  6. 正文要写清楚:是什么、为什么、怎么做


  1. How To Write a Git Commit Message ↩︎

  2. 5 Useful Tips For A Better Commit Message ↩︎

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
git commit message helper是一个辅助工具,用于帮助我们编写更好的git提交信息。 在进行版本控制时,我们通常会使用git进行代码管理,并且会通过提交(commit)来记录每次的修改。一个好的提交信息可以让其他人更容易理解我们做了哪些修改以及修改的原因。 git commit message helper可以提供以下功能: 1. 提供格式规范:git commit message helper可以为我们提供一份提交信息的格式规范。这样,在编写提交信息时,我们可以按照这个规范来进行,以遵循一致的风格。 2. 提示关键信息:git commit message helper可以通过自动补全或显示相关选项来提示我们填写关键信息。比如,当我们输入某个关键词时,它可以自动给出一些常见的选项供我们选择,以避免遗漏重要信息或填写错误。 3. 语法检查:git commit message helper可以帮助我们进行提交信息的语法检查。它可以检查是否符合规范,是否存在拼写错误等,从而提供更准确的提交信息。 4. 快捷操作:git commit message helper可以提供一些快捷操作,以便更方便地编写提交信息。比如,可以设置快捷键或命令来快速填写某些常用的信息,如修改的模块、bug修复等。 总而言之,git commit message helper是一个实用工具,可以帮助我们编写更好、更准确的提交信息。它不仅可以提高版本控制的效率,还有助于团队合作和代码维护的规范性。使用这个工具可以在一定程度上提高代码开发和管理的效果。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值