Skilldrick Skilldrick - 4 years ago 202
Git Question

Should I use past or present tense in git commit messages?

I read once that git commit messages should be in the imperative present tense, e.g. "Add tests for x". I always find myself using the past tense, e.g. "Added tests for x" though, which feels a lot more natural to me.

Here's a recent John Resig commit showing the two in one message:


Tweak some more jQuery set results in the manipulation tests. Also fixed the order of the expected test results.


Does it matter? Which should I use?

Answer Source

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

the body should provide a meaningful commit message, which:
- uses the imperative, present tense: "change", not "changed" or "changes".

So you'll see a lot of Git commit messages written in that style. But it doesn't matter -- you can do whatever you prefer.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download