git commit message convention

The following provides a common structure used for Git-based commit messages.


<empty line>
<empty line; if meta content exists>

key points

  • The summary has a suggested limit of fifty (50) characters.
  • Promotes small/description message.
  • Fits in Git shortlogs, gitk, etc.
  • The summary has a strenuously suggested limit of twenty-two (72) characters.
  • Fits with eighty (80) character terminals; considering some common usage for a four (4) character pre-fix tab for showing logs (and leaving four (4) character space at the end of each line).
  • The summary is suggested to be in lower case.
  • Clean and consistent casing for descriptions.
  • The summary is suggested to not end with a period.
  • Treat as a title.
  • The description has a suggested limit of twenty-two (72) characters on a single line.
  • Same reason as the summary; however, there are proper use cases for lines exceeding this limit. For example, complete URLs, and output dump or more.

common meta usages (but not limited to)