Commit Message Convention
In one line
A commit message convention is a set of rules for structuring commit messages so history is readable and automatable.
In simple words
A commit message convention is an agreed style for writing commit messages. A good convention makes git log readable, helps reviewers understand changes, and enables tooling (changelogs, release notes, version bumps). The most widely adopted is the seven rules of a great commit message.
The core rules: separate subject from body with a blank line, limit the subject to 50 characters, capitalize the subject, do not end the subject with a period, use the imperative mood ("add" not "added"), wrap the body at 72 characters, and use the body to explain what and why (not how). Conventional Commits adds a type prefix for automation.
A good message answers why the change is needed and what it does, not how it does it (the diff shows how). Bad messages like "fix", "wip", or "update" are useless in history. Discipline here pays off every time someone reads git log or bisects a bug.
Example
# Good commit message
fix(parser): reject input exceeding max length
Previously the parser accepted arbitrarily long input,
which caused a stack overflow on the 1MB test case.
This adds an upfront length check and a clear error.
Closes #142
# Bad commit messages (avoid)
# fix
# wip
# updated stuff
# doneSubject ≤50 chars, imperative mood, blank line, body wrapped at 72 explaining why. Closes #142 links the issue.
Related terms
Related Resources
Related Lessons
- Commit Practices
Learn commit conventions.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.