Git Commit Message Convention

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

Structure

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

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 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, output dump or more.

Common Meta usages (but not limited to)

Signed-off-by:
Acked-by:
Tested-by:
Reviewed-by:
Suggested-by:
Bug-identified-by:
Review-identified-by:

Examples