General
Commit Message Generator: Conventional Commits Format, Examples, and Rules
Table of contents
The Conventional Commits formatSubject line rulesThe body: what changed, and whyCommon mistakesGenerate one from your diffEvery developer has written "fix stuff" at 2 a.m. and regretted it during the next
The specification is deliberately small:
The type says what kind of change it is. The ones you will use daily:
-
-
-
-
-
-
-
The scope, in parentheses, names the area touched:
The subject is the only line most people ever read, in
- Imperative mood. Write "add retry logic", not "adds retry logic" or "added retry logic". The convention comes from Git itself: the subject completes the sentence "This commit will…".
- 72 characters or fewer. Longer subjects get truncated in GitHub and most log views. If you cannot fit it, the commit probably does two things.
- No trailing period. It is a title, not a sentence.
- Lowercase after the colon.
The diff already shows what changed line by line. The body exists to explain *why* — the context a reviewer cannot get from the diff. Compare:
with:
The second version tells a reviewer exactly what to look at and tells future-you why the code looks the way it does. Wrap body lines at 72 characters, and use bullet points when a commit contains several distinct changes.
- Past tense subjects ("fixed the bug") — the single most common style slip.
- Vague verbs — "update code", "change stuff", "misc fixes" say nothing. Name the thing that changed.
- One commit, five changes — if the subject needs an "and", split the commit. Reviewers and bisect both thank you.
- Copying the ticket title — tickets describe the problem; commits describe the solution.
- Explaining the diff line by line — the body is for motivation and trade-offs, not a narration of the patch.
If you would rather not format these by hand, the Commit & PR Generator takes a git diff (or a plain description of your change) and produces a Conventional Commits message plus a structured PR description with Summary, Changes, and Test plan sections. It works only from what you paste — it will not invent files or behavior that are not in your input — and it is free to try without signing up.
Two habits pair well with it. First, if you write messages yourself, run them through the grammar checker with the "Commit message" scenario selected: it enforces imperative mood and the 72-character subject while leaving your
Good commit messages are a small discipline with outsized returns: faster reviews, working changelogs, and a history you can actually search. The format takes five minutes to learn; the generator handles the rest.
git bisect. Commit messages are documentation you write for your future self and your reviewers, and the Conventional Commits format exists to make them consistent enough that tools can parse them — changelogs, semantic versioning bumps, and release notes all depend on it. This guide covers the format, the rules that matter, and the mistakes to avoid. At the end there is a free generator that turns your diff into a ready-to-paste message.The Conventional Commits format
The specification is deliberately small:
<type>[optional scope]: <description>
[optional body]
[optional footer]
The type says what kind of change it is. The ones you will use daily:
-
feat — a new feature-
fix — a bug fix-
docs — documentation only-
refactor — code change that neither fixes a bug nor adds a feature-
perf — a performance improvement-
test — adding or fixing tests-
chore — build, tooling, and maintenance workThe scope, in parentheses, names the area touched:
fix(payment):, feat(auth):. Breaking changes get an ! after the type or scope (feat(api)!:) or a BREAKING CHANGE: footer. Our commit message convention guide compares this spec against commitlint and other enforcement approaches if you want to go deeper.Subject line rules
The subject is the only line most people ever read, in
git log --oneline, in blame views, and in release notes. Four rules cover almost everything:- Imperative mood. Write "add retry logic", not "adds retry logic" or "added retry logic". The convention comes from Git itself: the subject completes the sentence "This commit will…".
- 72 characters or fewer. Longer subjects get truncated in GitHub and most log views. If you cannot fit it, the commit probably does two things.
- No trailing period. It is a title, not a sentence.
- Lowercase after the colon.
fix: handle empty cache reads consistently in a long log; mixed casing does not.The body: what changed, and why
The diff already shows what changed line by line. The body exists to explain *why* — the context a reviewer cannot get from the diff. Compare:
fix stuff in payment
with:
fix(payment): add exponential backoff to charge retries
Fixed-interval retries were hammering the API on timeouts and
causing duplicate charges. Sleep 2^attempt seconds between
attempts and raise the retry count from 3 to 5.
The second version tells a reviewer exactly what to look at and tells future-you why the code looks the way it does. Wrap body lines at 72 characters, and use bullet points when a commit contains several distinct changes.
Common mistakes
- Past tense subjects ("fixed the bug") — the single most common style slip.
- Vague verbs — "update code", "change stuff", "misc fixes" say nothing. Name the thing that changed.
- One commit, five changes — if the subject needs an "and", split the commit. Reviewers and bisect both thank you.
- Copying the ticket title — tickets describe the problem; commits describe the solution.
- Explaining the diff line by line — the body is for motivation and trade-offs, not a narration of the patch.
Generate one from your diff
If you would rather not format these by hand, the Commit & PR Generator takes a git diff (or a plain description of your change) and produces a Conventional Commits message plus a structured PR description with Summary, Changes, and Test plan sections. It works only from what you paste — it will not invent files or behavior that are not in your input — and it is free to try without signing up.
Two habits pair well with it. First, if you write messages yourself, run them through the grammar checker with the "Commit message" scenario selected: it enforces imperative mood and the 72-character subject while leaving your
feat: prefixes and code identifiers untouched. Second, if you want the check to happen automatically, our guide to a pre-commit hook for grammar checking shows how to wire it into your local workflow.Good commit messages are a small discipline with outsized returns: faster reviews, working changelogs, and a history you can actually search. The format takes five minutes to learn; the generator handles the rest.
📌 Prices and tool count in this article may be outdated. Lint now ships 16 tools with Pro at $12/mo, or $60/year. See the current pricing page.
Stop letting Grammarly break your code
17 AI tools built for developers. Code-aware parsing.
Or upgrade to Pro for 500 checks a day · All tools · No ads