One good article on commit message is How to Write a Git Commit Message.

Its rule n° 5 indeed recommends using imperative mood.

The imperative can sound a little rude; that's why we don't often use it. But it's perfect for git commit subject lines.
One reason for this is that git itself uses the imperative whenever it creates a commit on your behalf.

In the case of your topic, a simple "Doesn't add xxx" is enough to complete the first part of your commit (the "positive statement", in imperative).

Answer from VonC on Stack Overflow
Top answer
1 of 5
14

One good article on commit message is How to Write a Git Commit Message.

Its rule n° 5 indeed recommends using imperative mood.

The imperative can sound a little rude; that's why we don't often use it. But it's perfect for git commit subject lines.
One reason for this is that git itself uses the imperative whenever it creates a commit on your behalf.

In the case of your topic, a simple "Doesn't add xxx" is enough to complete the first part of your commit (the "positive statement", in imperative).

2 of 5
6

I assume that you are trying to decide whether

 Don't add hashing      #1

or

 Didn't add hashing     #2a
 Doesn't add hashing    #2b

is imperative. This is really an English grammar question. But to answer it, we first need to turn the contractions back into their full forms:

 Do not add hashing        #1
 (It) did not add hashing  #2a
 (It) does not add hashing #2b

The first of these is an instruction or command ... telling people not to add hashing. That is imperative.

The second two are simple statements of fact about the commit. They are saying that the commit does not or did not add hashing. This is not a direction or a command to anyone, therefore it is not imperative. (Either "does not" or "did not" is correct. It depends on whether you interpret the message in time-frame of the person writing it or the person reading it.)

By that analysis, the #1 and #2 forms would clearly mean very different things in a commit message. It is far more important that your commit messages should say what you actually mean, than that they should conform to some stylistic rules or conventions.


However ...

I'm still not totally clear about the way git commit messages are supposed to be written.

There is no single definitive authority on that topic. My recommendation would be not to sweat tears over it. Do what feels right to you. If people complain, ask them to explain in detail what you have done wrong, and try to learn. (Bear in mind that some people are never satisfied.)

🌐
TheServerSide
theserverside.com › blog › Coffee-Talk-Java-News-Stories-and-Opinions › git-commit-message-imperative-mood-past-tense-convention-standards-best-practice-subject
Imperative Git commit messages in the active tense or mood
March 22, 2024 - If applied this Git commit message will… · Fixed the buffer overflow issue. Fixing the buffer overflow issue. Fix the buffer overflow issue. If you selected option 3, then you’ve mastered the imperative mood.
Discussions

Should I use past or present tense in git commit messages? - Stack Overflow
The preference for present-tense, imperative-style commit messages comes from Git itself. From Documentation/SubmittingPatches in the Git repo: Describe your changes in imperative mood, e.g. More on stackoverflow.com
🌐 stackoverflow.com
version control - Why is it preferred to write a commit message in present tense/imperative mood? - Software Engineering Stack Exchange
I often read/overhear that good commit messages should be written in present tense or to use imperative mood when describing the change eg. Fix xyz instead of Fixed xyz. What are the advantages of doing so? Are there differences between the various VCS (I mostly read these about git but that ... More on softwareengineering.stackexchange.com
🌐 softwareengineering.stackexchange.com
Commit message examples in book not using imperative mood
Not all example commit messages in the source files are using the imperative mood. ... Go to https://github.com/progit/progit2/blob/master/book/03-git-branching/sections/basic-branching-and-merging.asc and search for: "fixed the broken email address". More on github.com
🌐 github.com
0
June 25, 2019
What % of Git commit messages use the imperative mood?
So it's of course fun to to this with bigquery, but you're likely able to get better results with manual labeling with barely more effort. How? Well, just take a random (unbiased!) sample. The thing is, even with a fairly doable sample, your error is going to get managable - and unlike bigquery and this kind of not-quite tuned NLP, the systemic error will be much, much smaller. Even rough eyeballing will likely do better on the systemic error front. And most critically: that method we can fairly well estimate how bad our error is. We know how good that works, and have reasonable error bars. We can redo the test with a different judge to estimate the person-to-person variance. This method? Well, could be 44% as the article computes... But could be 66% - who knows? There's no good way to validate the accuracy of these numbers without essentially throwing the whole point of the method away. So while nifty, plain old classical (manual) statistics works much better here. More on reddit.com
🌐 r/programming
44
56
June 20, 2020
🌐
Reddit
reddit.com › r/programming › what % of git commit messages use the imperative mood?
r/programming on Reddit: What % of Git commit messages use the imperative mood?
June 20, 2020 - It is a snapshot of changes at commit time, so it makes sense that the message would describe those actions at commit time. If the purpose of the message is framed from more of a future-human ("let's make this easy for the team down the line") ...
🌐
Vonage
developer.vonage.com › en › blog › how-to-write-a-great-git-commit-message
How to Write a GREAT Git Commit Message
June 27, 2024 - Keeping in mind the standard convention, write commit messages in the imperative mood, a tense typically associated with commands and actions.
Top answer
1 of 7
888

The preference for present-tense, imperative-style commit messages comes from Git itself. From Documentation/SubmittingPatches in the Git repo:

Describe your changes in imperative mood, e.g. "make xyzzy do frotz" instead of "[This patch] makes xyzzy do frotz" or "[I] changed xyzzy to do frotz", as if you are giving orders to the codebase to change its behavior.

So you'll see a lot of Git commit messages written in that style. If you're working on a team or on open source software, it is helpful if everyone sticks to that style for consistency. Even if you're working on a private project, and you're the only one who will ever see your git history, it's helpful to use the imperative mood because it establishes good habits that will be appreciated when you're working with others.

2 of 7
460

Your project should almost always use the past tense. In any case, the project should always use the same tense for consistency and clarity.

I understand some of the other arguments arguing to use the present tense, but they usually don't apply. The following bullet points are common arguments for writing in the present tense, and my response.

  • Writing in the present tense tells someone what applying the commit will do, rather than what you did.

This is the most correct reason one would want to use the present tense, but only with the right style of project. This manner of thinking considers all commits as optional improvements or features, and you are free to decide which commits to keep and which to reject in your particular repository.

This argument works if you are dealing with a truly distributed project. If you are dealing with a distributed project, you are probably working on an open source project. And it is probably a very large project if it is really distributed. In fact, it's probably either the Linux kernel or Git. Since Linux is likely what caused Git to spread and gain in popularity, it's easy to understand why people would consider its style the authority. Yes, the style makes sense with those two projects. Or, in general, it works with large, open source, distributed projects.

That being said, most projects in source control do not work like this. It is usually incorrect for most repositories. It's a modern way of thinking about a commits: Subversion (SVN) and CVS repositories could barely support this style of repository check-ins. Usually an integration branch handled filtering bad check-ins, but those generally weren't considered "optional" or "nice-to-have features".

In most scenarios, when you are making commits to a source repository, you are writing a journal entry which describes what changed with this update, to make it easier for others in the future to understand why a change was made. It generally isn't an optional change - other people in the project are required to either merge or rebase on it. You don't write a diary entry such as "Dear diary, today I meet a boy and he says hello to me.", but instead you write "I met a boy and he said hello to me."

Finally, for such non-distributed projects, 99.99% of the time a person will be reading a commit message is for reading history - history is read in the past tense. 0.01% of the time it will be deciding whether or not they should apply this commit or integrate it into their branch/repository.

  • Consistency. That's how it is in many projects (including git itself). Also git tools that generate commits (like git merge or git revert) do it.

No, I guarantee you that the majority of projects ever logged in a version control system have had their history in the past tense (I don't have references, but it's probably right, considering the present tense argument is new since Git). "Revision" messages or commit messages in the present tense only started making sense in truly distributed projects - see the first point above.

  • People not only read history to know "what happened to this codebase", but also to answer questions like "what happens when I cherry-pick this commit", or "what kind of new things will happen to my code base because of these commits I may or may not merge in the future".

See the first point. 99.99% of the time a person will be reading a commit message is for reading history - history is read in the past tense. 0.01% of the time it will be deciding whether or not they should apply this commit or integrate it into their branch/repository. 99.99% beats 0.01%.

  • It's usually shorter

I've never seen a good argument that says use improper tense/grammar because it's shorter. You'll probably only save 3 characters on average for a standard 50 character message. That being said, the present tense on average will probably be a few characters shorter.

  • You can name commits more consistently with titles of tickets in your issue/feature tracker (which don't use past tense, although sometimes future)

Tickets are written as either something that is currently happening (e.g. the app is showing the wrong behavior when I click this button), or something that needs to be done in the future (e.g. the text will need a review by the editor).

History (i.e. commit messages) is written as something that was done in the past (e.g. the problem was fixed).

🌐
Initial Commit
initialcommit.com › blog › Git-Commit-Message-Imperative-Mood
What % of Git commit messages use the imperative mood?
The resulting output of the above query is 104,057,902 commits. Dividing this by 237,447,598 (the total number of commits we calculated above) yields 43.8%. Therefore, we can estimate that approximately 44% of commit messages in the GitHub dataset use the imperative mood.
Find elsewhere
🌐
Hacker News
news.ycombinator.com › item
Out of all common advice on Git commit messages always using the imperative mood... | Hacker News
September 27, 2015 - In my own projects I use the imperative when describing the actions the system should perform ("Don't warn user about missing cache directory") but use the indicative mood when describing my own actions ("Removed unnecessary cache directory warning"). I've noticed that some projects use the ...
🌐
Dan Clarke
danclarke.com › git-tense
Git Commits: Past or Imperative? - Dan Clarke
Up until about six months ago, all my commits have used past tense. For example, I'd write "Added ...", or "Fixed ...", etc. However, at my current contract, they have a standard where the commits use imperative tense, eg.
🌐
cbeams
cbea.ms › git-commit
How to Write a Git Commit Message - cbeams
May 27, 2023 - Imperative mood just means “spoken or written as if giving a command or instruction”. A few examples: ... Each of the seven rules you’re reading about right now are written in the imperative (“Wrap the body at 72 characters”, etc.). ...
🌐
Medium
medium.com › @nathvichea › how-to-write-a-perfect-git-commit-message-6e4be4fd0944
How to Write a Perfect Git Commit Message | by Vichea Nath | Medium
October 9, 2023 - Writing a perfect Git commit message is an art! Here’s a simple template you can follow: Separate subject from body with a blank line: Start with a concise, clear subject line, followed by a blank line before the body. Keep the subject line short and descriptive: The subject line should be around 50 characters and summarily describe the change. Use the imperative mood: Write your commit message in the imperative mood, like you’re giving an order.
🌐
The Stack Newsletter
trythestack.co › the stack newsletter › how and when to use the imperative mood in business
Imperative Mood in Git Commits: Rules & Examples (2026 Guide)
February 15, 2026 - Learn to use imperative mood in git commit messages: "Fix bug" not "Fixed bug." Grammar rules, examples, and why commits describe what the code does, not did.
🌐
GitHub
github.com › AsyrafHussin › agent-skills › blob › main › skills › git-workflow › rules › commit-imperative-mood.md
agent-skills/skills/git-workflow/rules/commit-imperative-mood.md at main · AsyrafHussin/agent-skills
Write commit messages in the imperative mood, as if giving a command or instruction. # Past tense git commit -m "fixed the login bug" git commit -m "added user authentication" git commit -m "updated the README" # Present participle (-ing form) ...
Author   AsyrafHussin
🌐
Nefi
nefi.ai › docs › usage › imperative-mood
Git's Imperative Mood - ‍♂️ Get started
The imperative mood is a powerful commit message convention widely adopted across Git repositories. It aligns with Git's own message style.
🌐
TheServerSide
theserverside.com › video › Follow-these-git-commit-message-guidelines
Git commit message conventions and best practices | TheServerSide
Don't write a git commit subject ... error. //bad · Fix the fencepost error. //good · The imperative mood is the one git commit message guideline that developers tend to violate most often....
🌐
Dev-toolbox
dev-toolbox.tech › home › git commit message generator › using imperative mood in commit messages
Using Imperative Mood in Commit Messages | DevToolbox
Git itself uses it: Git's auto-generated messages use imperative mood: ... The @commitlint/config-conventional preset does not enforce imperative mood by default, but you can add a custom rule or use the subject-case rule to enforce lowercase (which naturally encourages imperative mood):
🌐
AltCampus
ac-blog.vercel.app › blog › how-to-write-good-git-commit-message
How to write good Git commit messages - AltCampus Blog
May 22, 2020 - Corresponding examples are ... Git commits are better written in an imperative mood since Git by default uses the imperative mood to report its actions. For example, look at commands such as git merge master, git add index.html, git merge branch1.
🌐
freeCodeCamp
freecodecamp.org › news › how-to-write-better-git-commit-messages
How to Write Better Git Commit Messages – A Step-By-Step Guide
January 4, 2022 - ... Capitalization and Punctuation: Capitalize the first word and do not end in punctuation. If using Conventional Commits, remember to use all lowercase. Mood: Use imperative mood in the subject line.
🌐
GitHub
github.com › progit › progit2 › issues › 1271
Commit message examples in book not using imperative mood · Issue #1271 · progit/progit2
June 25, 2019 - Reference to our style guide for commits: From https://github.com/progit/progit2/blob/master/book/05-distributed-git/sections/contributing.asc Write your commit message in the imperative: "Fix bug" and not "Fixed bug" or "Fixes bug." I'm willing to fix the issue, by making new pull-requests, if @ben wants to change the example commit messages too.
Author   progit