How to Write a Git Commit Message

If you’re here it means that you’re already able to write proper commit messages. So it’s time to take a closer look at git blame command and set things in order a little bit.

If you browse your git repository’s logs, you’ll probably find its commit messages messed up. Here’s an example from my early days in committing:

Compare that with more fix commits from the same repository:

Which one is better?

To sum things up, here are 4 rules of good git commit message:

  1. Isolate subject from body with a line
  2. Limit the subject line to 50 words
  3. Capitalize the subject
  4. Do not end the subject line with a period

Stick to the rules and will be fine.

One clap, two clap, three clap, forty?

By clapping more or less, you can signal to us which stories really stand out.