Let's pick each other's brains for a sec.
Do you use past or imperative tense in your commit messages?
Past
added button to page
Imperative
add button to page
Discuss
Why? Pros vs. cons? Have you tried one and moved to the other? Which one makes better sense?
Top comments (31)
I usually use the present tense. It sounds more natural when thinking in terms of "what does this specific commit do". I think of a commit is a snapshot of an event, rather than a fixed point in history or a changelog.
+1000 to this. It also lends itself to easier reading/scrolling through
git log
. ๐I love these guidelines chris.beams.io/posts/git-commit/
โA properly formed Git commit subject line should always be able to complete the following sentence:
If applied, this commit will your subject line here
For example:
If applied, this commit will refactor subsystem X for readabilityโ
Meaning imperative instead of present or past tense
The imperative is a mood not a tense! :) I use present tense and follow the Conventional Commits specification on most projects ("fix: disable current deployment type in index filters").
Here is a small statistic based on the Github commit messages:
Fix: 25M
Fixed: 12M
Fixing: 22M
Fixes: 23M
Add: 25M
Added: 22M
Adding: 19M
Update: 18M
Updated: 14M
Updating: 18M
Remove: 25M
Removed: 18M
Removing: 18M
Removal: 7M
Delete: 7M
Deleted: 8M
Deleting: 9M
We can see that the imperative is used a little more than the past tense.
Personally, I use past tense because it sounds more polite.
I usually follow the guidelines proposed here which I think they make valid points. See section 5: use the imperative mood in the subject line.
I also adhere to the Conventional Commits spec.
I'm using past tense (at least mostly) because the commit reflects something I did in the past. Seems natural to me this way...
I finish this sentence "If you pull this it ..."
i.e.
adds new feature to menu
updates readme
fixes broken sql
This is good.
Using imperatives is the official way of writing commit messages, as if each message were prefixed by "This commit will...". I personally prefer this as it's very straightforward and shortens some messages by a few characters.
From git-scm.com/book/en/v2/Distributed...
I was using past tense till I realized present simple is being used in GitHub, GitLab, and GitKraken commits (Add/Update README, Merge: foo, Revert: bar).
I like to use Imperative for consistency with Jira tickets.
Some comments may only be visible to logged-in visitors. Sign in to view all comments.