Conventional Commits v1.0.0-beta.2
Structured commit messages that enable automated changelogs and semantic versioning.
Format
code
<type>[optional scope]: <description> [optional body] [optional footer]
Quick Reference
| Type | Purpose | SemVer Impact |
|---|---|---|
feat | New feature (MUST use for new features) | MINOR bump |
fix | Bug fix (MUST use for bug fixes) | PATCH bump |
docs | Documentation only | None |
style | Formatting, no code change | None |
refactor | Neither fix nor feature | None |
perf | Performance improvement | None |
test | Adding/fixing tests | None |
chore | Build, tooling, deps | None |
Any + BREAKING CHANGE | Breaking API change | MAJOR bump |
The 11 Specification Rules
- •Commits MUST be prefixed with a lowercase type (noun:
feat,fix, etc.) followed by colon and space - •
featMUST be used when a commit adds a new feature - •
fixMUST be used when a commit represents a bug fix - •Optional scope MAY follow the type in parentheses:
fix(parser): - •Description MUST immediately follow the type/scope prefix
- •Longer body MAY follow after one blank line after description (may contain multiple paragraphs)
- •Footer MAY follow one blank line after body (or description if no body). Multiple footers allowed using
token: valueortoken #valueformat - •Breaking changes MUST be indicated at the very beginning of the footer or body section as uppercase
BREAKING CHANGE:(orBREAKING-CHANGE:) followed by a space - •A description MUST be provided after
BREAKING CHANGE: - •Types other than
featandfixMAY be used - •
!MAY be appended after type/scope (with or without scope:feat!:orfeat(scope)!:) to draw attention to breaking change.BREAKING CHANGE:in footer MUST also be included when!is used
Examples
Simple feature:
code
feat: add email notifications for order updates
Scoped bug fix:
code
fix(auth): prevent session fixation on login
Breaking change with ! and footer:
code
refactor(api)!: remove deprecated /v1 endpoints Migrate all clients to /v2 before upgrading. BREAKING CHANGE: /v1/* endpoints have been removed. Use /v2/* instead.
Breaking change without scope (using !):
code
feat!: drop Node 14 support BREAKING CHANGE: minimum Node version is now 16.
Multiple footers:
code
feat(parser): support nested array syntax Arrays can now contain other arrays, enabling complex data structures in configuration files. Reviewed-by: Alice Closes #245
Common Mistakes
| Mistake | Correct |
|---|---|
Fixed bug in login | fix(auth): resolve null check on login |
feat: Fix typo | fix: correct typo in README (not a feature) |
BREAKING CHANGE without footer format | Must be at start of footer/body: BREAKING CHANGE: description |
feat!: without BREAKING CHANGE in footer | Rule 11: ! requires BREAKING CHANGE: in footer too |
| Missing blank line before body | Body MUST be separated by one blank line |
Scope with spaces feat(my scope): | Use hyphens: feat(my-scope): |