What are Conventional Commits?
Conventional Commits is a specification for commit messages: type(scope): description, an optional body, and optional footers. The fixed format lets tools such as semantic-release, release-please and commitlint generate changelogs, pick the next version number and reject malformed messages.
What is the Conventional Commits format?
The header is type, an optional scope in parentheses, an optional ! for a breaking change, a colon, one space and a short description, for example feat(api): add pagination. A blank line separates the header from the body, and another blank line comes before footers such as BREAKING CHANGE: or Closes #42.
Which commit types can I use?
The spec requires only feat and fix. The widely used @commitlint/config-conventional preset also allows build, chore, ci, docs, perf, refactor, revert, style and test. Types are lowercase.
How do I mark a breaking change?
Add ! before the colon, as in feat(api)!: remove v1 endpoints, or add a footer that starts with BREAKING CHANGE: followed by what breaks. Either one triggers a major version bump. The footer token must be uppercase.
Which version bump does a commit trigger?
With semantic-release defaults, a breaking change bumps the major version, feat bumps the minor version, and fix, perf and revert bump the patch version. docs, style, refactor, test, build, ci and chore do not cause a release on their own.
Should the description start with a capital letter?
No. commitlint's conventional preset rejects descriptions in sentence case, start case or all capitals, and a trailing period. Write it in the imperative mood, like a command: fix login redirect, not Fixed login redirect.