You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: book/05-distributed-git/sections/contributing.asc
+17-15Lines changed: 17 additions & 15 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -59,30 +59,32 @@ The last thing to keep in mind is the commit message.
59
59
Getting in the habit of creating quality commit messages makes using and collaborating with Git a lot easier.
60
60
As a general rule, your messages should start with a single line that's no more than about 50 characters and that describes the changeset concisely, followed by a blank line, followed by a more detailed explanation.
61
61
The Git project requires that the more detailed explanation include your motivation for the change and contrast its implementation with previous behavior -- this is a good guideline to follow.
62
-
It's also a good idea to use the imperative present tense in these messages.
63
-
In other words, use commands.
64
-
Instead of ``I added tests for'' or ``Adding tests for,'' use ``Add tests for.''
62
+
Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug."
65
63
Here is a https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html[template originally written by Tim Pope]:
66
64
67
65
[source,text]
68
66
----
69
-
Short (50 chars or less) summary of changes
67
+
Capitalized, short (50 chars or less) summary
70
68
71
-
More detailed explanatory text, if necessary. Wrap it to
72
-
about 72 characters or so. In some contexts, the first
73
-
line is treated as the subject of an email and the rest of
74
-
the text as the body. The blank line separating the
75
-
summary from the body is critical (unless you omit the body
76
-
entirely); tools like rebase can get confused if you run
77
-
the two together.
69
+
More detailed explanatory text, if necessary. Wrap it to about 72
70
+
characters or so. In some contexts, the first line is treated as the
71
+
subject of an email and the rest of the text as the body. The blank
72
+
line separating the summary from the body is critical (unless you omit
73
+
the body entirely); tools like rebase can get confused if you run the
74
+
two together.
75
+
76
+
Write your commit message in the imperative: "Fix bug" and not "Fixed bug"
77
+
or "Fixes bug." This convention matches up with commit messages generated
78
+
by commands like git merge and git revert.
78
79
79
80
Further paragraphs come after blank lines.
80
81
81
-
- Bullet points are okay, too
82
+
- Bullet points are okay, too
83
+
84
+
- Typically a hyphen or asterisk is used for the bullet, followed by a
85
+
single space, with blank lines in between, but conventions vary here
82
86
83
-
- Typically a hyphen or asterisk is used for the bullet,
84
-
preceded by a single space, with blank lines in
85
-
between, but conventions vary here
87
+
- Use a hanging indent
86
88
----
87
89
88
90
If all your commit messages follow this model, things will be much easier for you and the developers with whom you collaborate.
0 commit comments