What are conventional commits?

In short
Conventional Commits is a simple set of rules for writing git commit messages. Each message starts with a type such as feat or fix, an optional scope, and a short description. Following the pattern makes commit history easy to read and lets tools generate changelogs and version numbers automatically.
Conventional Commits is a lightweight convention placed on top of ordinary commit messages. A commit message is the short note you attach to a change when you save it in git, the version control tool most developers use. Normally these notes are free text, so every team writes them differently. Conventional Commits gives everyone one shared pattern.
How the message is built
The first line follows this shape:
<type>[optional scope]: <description>
The type says what kind of change you made. The scope, written in parentheses, names the part of the project you touched. The description is a short summary written after a colon and a space. An optional body with more detail can come after one blank line, and optional footers can come after another blank line.
The specification names two types that carry special meaning. A fix: commit patches a bug. A feat: commit adds a new feature. Other types are allowed too, such as docs: for documentation, test: for tests, refactor: for code cleanup that does not change behavior, and chore: for routine maintenance. The specification does not require these extra types, but common tool configurations recommend them.
Marking breaking changes
A breaking change is an edit that forces users of your code to adjust what they do. You can flag one in two ways. Add a footer that starts with the uppercase words BREAKING CHANGE followed by a colon and a description. Or add an exclamation mark just before the colon in the first line, such as feat!:. When you use the exclamation mark, the description on the first line can explain the change, so the footer becomes optional.
A simple example
Suppose you added a feature that lets users sort a list, and separately fixed a crash. Your commits could look like this:
feat(list): add sorting by date
fix(login): stop crash when password field is empty
A developer who reads the history can now see at a glance which commit added something new and which one repaired a problem. A reader who sees feat(list) knows the change lives in the list part of the project.
Why teams use it
The main benefit is that the messages are predictable. Tools can read them and do useful work. A tool can build a changelog, which is a human-readable list of changes for each release. It can also decide the next version number. The specification maps fix to a patch release, feat to a minor release, and a breaking change to a major release. This follows Semantic Versioning, a common scheme where version numbers have three parts for major, minor and patch changes. Teammates also benefit, because they can scan a history quickly and understand what kind of work each commit represents.
Common mistakes
The type and the colon must be right, because tools depend on them. The specification requires a colon and a space right after the type or scope, and a description must follow immediately. Keep the description short and describe what the code change does.
Another common issue is putting several unrelated changes into one commit. The specification suggests making several commits when one change fits more than one type. It also suggests fixing a wrong type before the change is merged, for example with an interactive rebase in git. If you are unsure, a squash-based workflow lets a lead maintainer tidy the message when a pull request is merged, so not every contributor needs to be perfect.
Getting started
You do not need special software to begin. Write your next commit message in the pattern above and see how it reads. Many teams add a commit message checker that warns when a message does not match. Once the habit is in place, the history becomes a useful record of your project. For more on how teams organize their work, read our other career guides.
FAQ
Do I need a special tool to use Conventional Commits?
No. The format is plain text that you type into your commit message. Tools are optional and can check messages or build changelogs for you.
Should the type be uppercase or lowercase?
The specification says any casing may be used, but it is best to pick one style and stay consistent across the project.
What if one commit fits two types?
The specification recommends splitting the work into several commits whenever possible, so each commit has one clear type.
What does a breaking change mean for version numbers?
According to the specification, a commit with a breaking change should lead to a major version release, regardless of its type.
What happens if I make a mistake in a commit message?
Before the change is merged or released, you can edit the history with git rebase in interactive mode. After release, the fix depends on your tools and processes.
Sources
This page is based on the official documentation below. Read it for full detail.
Conventional Commits — official documentation ↗