This document discusses best practices for writing good commit messages in Git. It recommends limiting the subject line to 50 characters, separating it from the body with a blank line, wrapping the body at 72 characters, using the imperative mood in the subject line, capitalizing the subject line, not ending it with a period, and using the body to explain what and why rather than how. It also provides tips like keeping commits atomic and configuring your editor for commit messages.
6. $ git log src/Namespace/ClassName.php
commit e91d0ef22e6e0d09a9216f365db55e167fb6e8a8
Author: John Doe <johndoe@example.com>
Date: Wed Feb 11 10:52:49 2015 -0200
Fix #35
7. $ git log src/Namespace/ClassName.php
commit e91d0ef22e6e0d09a9216f365db55e167fb6e8a8
Author: John Doe <johndoe@example.com>
Date: Wed Feb 11 10:52:49 2015 -0200
Fix #35
The company just moved
from GitHub to GitLab
8. $ git log src/Namespace/ClassName.php
commit e91d0ef22e6e0d09a9216f365db55e167fb6e8a8
Author: John Doe <johndoe@example.com>
Date: Wed Feb 11 10:52:49 2015 -0200
Fix #35
The company just moved
from GitHub to GitLab
Does not work
in the company anymore
20. commit ca8f13d1da23d1912602ce51837f6515a3142ede
Author: Author Name <author@example.com>
Date: Thu May 17 19:00:00 2018 +0200
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
Signed-off-by: Author Name <author@example.com>
Reviewed-by: Reviewer Name <reviewer@example.com>
Body
Subject