Skip to content

git_commit_message_style_guide

Jeffrey Carpenter edited this page Sep 30, 2013 · 1 revision

Git Commit Message Style Guide

The first line of the commit message should be a short description (50 characters is the soft limit), and should skip the full stop.

If you continue your message on past the full stop, keep to a 72..76 line soft limit; this keeps git log from soft-wrapping your lines.

  • Use the imperative, present tense: “change" not “changed" or "changes" -- "Rename the iVars to remove the common prefix" not "Renamed the iVars and removed the common prefix".
    • This informs you of what the commit will do upon applying it, rather than what you did. This is also consistent with git generated log messages, such as when merging: "Merge branch with dev".
    • A meaningful message includes motivation for the change, and contrasts its implementation with previous behavior.

If you are using git submodules, consider including the submodule repo commit in the same batch as your modifications to the other git repo.

References