cnuc

cnuc

Git commit messages

2020-03-23

OK, so I read three articles/blog posts about good commit messages. I did this so you don’t have to. The best one of then was this one by Jacob Herrington.

  • The first line of the commit message is the subject line.
    • Start with a capital letter.
    • Use no more than 50 letters.
    • Don’t end with a period.
    • This should be a good summary of the change.
    • Write in imperative mood: Fix, not Fixes or Fixed.
  • The second line should always be empty.
  • The body of the commit message should focus on why the change was made. (Unless it is a minor obvious change)
  • Then write what was done. Give context. This is the part that the subject line of the commit message is summarizing.

Happy committing.