luc*_*nte 9 git version-control formatting conventions
在git的提交消息(COMMIT_EDITMSG)中使用的推荐格式是什么,如果有的话?
Jak*_*org 13
当然,它有所不同,但是一种非常常见的格式是这样的(取自http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html,我认为总和它真的很好):
Short (50 chars or less) summary of changes
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.
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
Run Code Online (Sandbox Code Playgroud)
它没有解决的一件事是我自己采用的东西,即在firstt行的开头使用短标签来识别它是什么类型的提交.这可能是一个标签,如错误[fix]修复,[new]新功能或[dev]仅影响内部的提交.使用这样的策略,可以轻松地从提交中自动生成更改日志.
编辑:这是另一个很好的总结,甚至来自这个网站:在git中,有什么好的约定可以将多个注释格式化为单个提交