follow for more tips on writing the perfect commit message
seen from Russia
seen from United States

seen from Germany
seen from China
seen from United States
seen from China
seen from United States
seen from China
seen from United Kingdom

seen from Germany

seen from United States

seen from United States
seen from Singapore
seen from United Kingdom
seen from China
seen from United States

seen from United States

seen from United States
seen from Brazil
seen from Austria
follow for more tips on writing the perfect commit message

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
This commit message template that helps you write great commit messages and enforce it across your team.
It started with Linus Torvalds’, What a good commit message looks like (2011)
MaxwellBo’s fork includes emojis
To apply the template, save the above file to your local machine and use git config --global commit.template <.git-commit-template.txt file path>
For example, if you saved it to your home folder, try: git config --global commit.template ~/.git-commit-template.txt
References
A useful template for commit messages
How to Write a Git Commit Message
Example for a Good Commit Message
【转帖】Commit message 编写指南
http://ift.tt/1PMWLXP
这是ruanyifeng老师发表的博文内容,摘抄如下。
如果是博客文章类的commit,这个格式还不适用。
二、Commit message 的格式
每次提交,Commit message 都包括三个部分:Header,Body 和 Footer。
<type>(<scope>): <subject> // 空一行 <body> // 空一行 <footer>
其中,Header 是必需的,Body 和 Footer 可以省略。
不管是哪一个部分,任何一行都不得超过72个字符(或100个字符)。这是为了避免自动换行影响美观。
2.1 Header
Header部分只有一行,包括三个字段:type(必需)、scope(可选)和subject(必需)。
(1)type
type用于说明 commit 的类别,只允许使用下面7个标识。
feat:新功能(feature)
fix:修补bug
docs:文档(documentation)
style: 格式(不影响代码运行的变动)
refactor:重构(即不是新增功能,也不是修改bug的代码变动)
test:增加测试
chore:构建过程或辅助工具的变动
如果type为feat和fix,则该 commit 将肯定出现在 Change log 之中。其他情况(docs、chore、style、refactor、test)由你决定,要不要放入 Change log,建议是不要。
(2)scope
scope用于说明 commit 影响的范围,比如数据层、控制层、视图层等等,视项目不同而不同。
(3)subject
subject是 commit 目的的简短描述,不超过50个字符。
以动词开头,使用第一人称现在时,比如change,而不是changed或changes
第一个字母小写
结尾不加句号(.)
2.2 Body
Body 部分是对本次 commit 的详细描述,可以分成多行。下面是一个范例。
More detailed explanatory text, if necessary. Wrap it to about 72 characters or so. Further paragraphs come after blank lines. - Bullet points are okay, too - Use a hanging indent
有两个注意点。
(1)使用第一人称现在时,比如使用change而不是changed或changes。
(2)应该说明代码变动的动机,以及与以前行为的对比。
2.3 Footer
Footer 部分只用于两种情况。
(1)不兼容变动
如果当前代码与上一个版本不兼容,则 Footer 部分以BREAKING CHANGE开头,后面是对变动的描述、以及变动理由和迁移方法。
BREAKING CHANGE: isolate scope bindings definition has changed. To migrate the code follow the example below: Before: scope: { myAttr: 'attribute', } After: scope: { myAttr: '@', } The removed `inject` wasn't generaly useful for directives so there should be no code using it.
(2)关闭 Issue
如果当前 commit 针对某个issue,那么可以在 Footer 部分关闭这个 issue 。
Closes #234
也可以一次关闭多个 issue 。
Closes #123, #245, #992
2.4 Revert
还有一种特殊情况,如果当前 commit 用于撤销以前的 commit,则必须以revert:开头,后面跟着被撤销 Commit 的 Header。
revert: feat(pencil): add 'graphiteWidth' option This reverts commit 667ecc1654a317a13331b17617d973392f415f02.
Body部分的格式是固定的,必须写成This reverts commit <hash>.,其中的hash是被撤销 commit 的 SHA 标识符。
如果当前 commit 与被撤销的 commit,在同一个发布(release)里面,那么它们都不会出现在 Change log 里面。如果两者在不同的发布,那么当前 commit,会出现在 Change log 的Reverts小标题下面。
from http://ift.tt/1TOAUOY
Merge conflicts ruin my commit message while squashing commits
Merge conflicts ruin my commit message while squashing commits
My usual workflow with git is to create a new feature branch, do some work with frequent commits, and then merge back into the development branch when the feature is working and/or stable.
Usually, when I do git merge --squash feature-branch, I get a nice “squashed commit of the following” message that auto-populates with all of the commit messages from the feature branch.
However, if there…
View On WordPress

Anya is live and ready to show you everything. Watch her strip, dance, and perform exclusive shows just for you. Interact in real-time and make your fantasies come true.
Free to watch • No registration required • HD streaming
Git commit message recommendations
The 50/72 message length recommendations from Tim Pope. Discussed also in the Atlassian Git-2 notes.
Clean code is important in an agile environment. It's courteous to leave clean, expressive code for the next developer who has to dig through it. [...] This same courtesy should also apply to your source control.
In diesem Artikel stellt sich Chris Rittersdorf der Frage wie Commits und Commitnachrichten mit Git besser optimiert und organisiert werden können mit dem Ziel ausdrucksstarken Code mit ausdrucksstarken Commitnachrichten zu versehen.