What Is a Conventional Commit?
A conventional commit is a commit whose message follows a structured format, like a type prefix and description, so tools and humans can parse intent.
Conventional Commits is a lightweight convention for writing commit messages in a consistent, machine-readable way. By starting each message with a type such as feat or fix, teams make history easier to scan and, crucially, enable tools to automate versioning and changelogs.
The format
A conventional commit message starts with a type, an optional scope in parentheses, a colon, and a short description. Common types include feat for a feature, fix for a bug fix, docs, refactor, test, and chore. An optional body and footer can add detail or flag breaking changes.
A conventional commit message
The structure is easy to write once it becomes habit.
git commit -m "feat(auth): add password reset flow"
git commit -m "fix(api): handle empty response body"Why structure helps
A consistent format makes history readable at a glance and lets tools reason about it. The type tells you the nature of each change, scopes group related work, and a marked breaking change signals a major bump. Humans benefit too: the log reads like a clear, categorized record.
Conventional commits in CI/CD
Automated release tools read conventional commit messages to decide the next version and generate changelogs. A fix produces a patch bump, a feat a minor bump, and a breaking change a major bump, all without manual version edits. This turns commit discipline into a fully automated release pipeline.
Adopting the convention
- Start each message with a type like feat, fix, or docs.
- Add a scope to group changes by area when helpful.
- Mark breaking changes so tools bump the major version.
- Pair with a release tool to automate versioning from history.
Key takeaways
- A conventional commit follows a structured, parseable message format.
- Type prefixes like feat and fix communicate the nature of a change.
- Release tools read them to automate versioning and changelogs.