I've read all kinds of Git tutorials, including the official one, and they all seem to tell me it's good convention and practice to write Git commit notes in the present tense.
Why is that? What is the reasoning behind it?
History (i.e. commit messages) is written as something that was done in the past (e.g. the problem was fixed). The thing is, using imperative, present tense works for huge projects (e.g. Linux) so it obviously scales. In addition, it requires pretty much zero effort using over past tense.
It is a good practice to use present tense in commit messages.
As I understand it, the present tense means that the commit itself fixes the issue, not the developer which could be implied by using the past tense -"the developer fixed the issue". I believe it would be the code being committed that fixes the issue, not the action of the commit.
Imperative (a.k.a. present tense) It tells someone what applying that commit will do, so it should read something like If I apply this commit, it will [make foo do something...]
Git is a distributed VCS (version control system). Multiple people can work on the same projects. It'll get changes from many sources.
Rather than writing messages that say what a committer has done. It's better to consider these messages as the instructions for what is going to be done after the commit is applied on the repo.
So write a message like this
Fix bug#1234
Instead of
Fixed bug #1234
Treat the git log not a history of your actions, but a sequence descriptions of what all the commits do.
There is a big thread on hacker news about it. There you'll get many more reasons behind this convention.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With