Conventional Commits Cheatsheet
Every pattern of the Conventional Commits spec: types, scopes, breaking changes, footers, semantic versioning, and tools, with syntax and real use cases.64 commands · 7 sections
Conventional Commits is a lightweight commit-message convention that drives semantic versioning, automatic changelogs, and clean history. This cheatsheet covers the format, every commit type, scopes, breaking changes, footers, and the tools that enforce it.
The format is simple: type(scope): description: followed by an optional body and footer.
The Format11
type(scope): descriptionfeat: descriptionfix: descriptiontype(scope): description
Body linetype: description
FOOTER: valuetype: description (#123)type!: descriptionrevert: type: descriptionci: / chore: / build:docs: / refactor: / perf: / test:style: descriptionCommit Types12
feat: add / new / supportfix: fix / correct / handledocs: document / update docs / clarifyrefactor: extract / rename / simplifyperf: optimize / speed up / reducetest: add tests / fix testsbuild: bump / configure buildci: add workflow / update pipelinechore: update deps / housekeepingstyle: format / lint fixperf + fix / feat + fix (split)refactor(full rewrite): ...Scopes & Breaking Changes8
feat(api): ...fix(router): ...feat(auth)!: ...feat: ...
BREAKING CHANGE: ...BREAKING-CHANGE: ...fix!: ...refactor(types)!: ...chore(deps)!: ...Examples11
feat(ui): add tooltip componentfix(api): return 404 for missing usersperf(db): index the email columndocs: add deployment guidetest: add e2e for checkout flowbuild: add esbuild bundle stepci: cache node_modules in workflowrefactor: extract auth middlewarestyle: sort importsfeat(cli)!: rename --prod to --productionfix: validate webhook signature
Prevents forged events. Closes #88.Semantic Versioning8
MAJOR.MINOR.PATCHBREAKING CHANGE → MAJORfeat → MINORfix → PATCH1.5.0-beta.1^1.4.0 / ~1.4.0semantic-releasedocs/chore/test → no bumpChangelog & Releases6
semantic-release generates CHANGELOG.mdconventional-changelog -p angular -i CHANGELOG.md -sgit log --oneline --grep="^feat"git log v1.0.0..HEAD --oneline --grep="BREAKING"git tag v2.0.0 && git push --tagsgit log --format="%s" v1.0.0..HEAD | grep -E "^(feat|fix)"Enforcement & Tools8
commitlintcommitlint config: "@commitlint/config-conventional"husky pre-commit hookcommitizensemantic-release + GitHub Actionssemantic-release --dry-runrelease-please (Google)git commit -m "feat: ..." (atomic)Conventional Commits Cheatsheet
Every pattern of the Conventional Commits spec: types, scopes, breaking changes, footers, semantic versioning, and tools, with syntax and real use cases.
Conventional Commits is a lightweight commit-message convention that drives semantic versioning, automatic changelogs, and clean history. This cheatsheet covers the format, every commit type, scopes, breaking changes, footers, and the tools that enforce it.
The format is simple: type(scope): description: followed by an optional body and footer.
The Format
type(scope): description: The core format: type, optional scope, and a description after a colon.feat: description: The two most common commits: feat for new functionality.fix: description: fix for bug fixes.type(scope): description
Body line: A blank line starts the body: WHY you made the change.type: description
FOOTER: value: Footers after the body: BREAKING CHANGE, Ref, Co-authored-by.type: description (#123): Convention for referencing PRs: popular on GitHub.type!: description: The ! marks a breaking change: no footer needed.revert: type: description: Reverting a previous commit: the revert prefix.ci: / chore: / build:: Tooling commits: CI config, chores, build system (not shipped features).docs: / refactor: / perf: / test:: Docs, refactors, performance, and tests: no behavior change.style: description: Formatting only: no logic change (spacing, semicolons).Commit Types
feat: add / new / support: A NEW feature for the user: bumps MINOR version.fix: fix / correct / handle: A bug fix: bumps PATCH version.docs: document / update docs / clarify: Documentation only: no version bump.refactor: extract / rename / simplify: Internal restructuring: no behavior change.perf: optimize / speed up / reduce: Performance improvement: faster or lighter.test: add tests / fix tests: Test code: new tests or fixes to existing ones.build: bump / configure build: Build system changes: bundlers, compilers, versions.ci: add workflow / update pipeline: CI/CD configuration changes.chore: update deps / housekeeping: Maintenance that fits nothing else.style: format / lint fix: Whitespace, formatting, lint: no logic change.perf + fix / feat + fix (split): One concern per commit: split mixed changes into multiple commits.refactor(full rewrite): ...: Scopes name the AREA: component, module, or package.Scopes & Breaking Changes
feat(api): ...: Scope names the affected area: api, cli, core, ui.fix(router): ...: Scope the fix to its module: history stays navigable.feat(auth)!: ...: Breaking change in a scoped feature: the ! suffix.feat: ...
BREAKING CHANGE: ...: The footer form: explain WHAT broke and HOW to migrate.BREAKING-CHANGE: ...: Alternative footer spelling: both are parsed.fix!: ...: Even a fix can be breaking: if the behavior change is incompatible.refactor(types)!: ...: Breaking refactors: type and interface changes.chore(deps)!: ...: Breaking dependency upgrades: major version bumps.Examples
feat(ui): add tooltip component: New UI feature: scoped to the ui area.fix(api): return 404 for missing users: Bug fix in the API: precise scope and outcome.perf(db): index the email column: Performance work scoped to the database layer.docs: add deployment guide: Documentation addition.test: add e2e for checkout flow: Test additions.build: add esbuild bundle step: Build configuration change.ci: cache node_modules in workflow: CI pipeline optimization.refactor: extract auth middleware: Internal cleanup without behavior change.style: sort imports: Formatting-only change.feat(cli)!: rename --prod to --production: Breaking CLI change: flag renamed.fix: validate webhook signature
Prevents forged events. Closes #88.: Full commit: subject, body, and issue reference.Semantic Versioning
MAJOR.MINOR.PATCH: The version scheme: 1.4.2 = major.minor.patch.BREAKING CHANGE → MAJOR: Breaking changes bump the major version: 1.4.2 → 2.0.0.feat → MINOR: New features bump minor: 1.4.2 → 1.5.0.fix → PATCH: Bug fixes bump patch: 1.4.2 → 1.4.3.1.5.0-beta.1: Pre-release identifiers: before the stable release.^1.4.0 / ~1.4.0: Ranges: ^ allows minor+patch, ~ allows patch only.semantic-release: The tool that derives versions from commit types automatically.docs/chore/test → no bump: Non-shipped changes never bump the version.Changelog & Releases
semantic-release generates CHANGELOG.md: Changelog sections come from commit types: Features, Fixes, BREAKING CHANGES.conventional-changelog -p angular -i CHANGELOG.md -s: Generate a changelog from git history (Angular preset).git log --oneline --grep="^feat": List feature commits since a release: draft release notes.git log v1.0.0..HEAD --oneline --grep="BREAKING": Collect breaking changes for the release notes.git tag v2.0.0 && git push --tags: Tag the release after the version bump: semantic-release does this for you.git log --format="%s" v1.0.0..HEAD | grep -E "^(feat|fix)": Plain-text release summary from commit subjects.Enforcement & Tools
commitlint: Lint commit messages: reject non-conforming formats.commitlint config: "@commitlint/config-conventional": The standard rule set: type, empty-scope, subject-case rules.husky pre-commit hook: Run commitlint before every commit: catches mistakes locally.commitizen: Interactive commit composer: picks types for you.semantic-release + GitHub Actions: Automate release: analyze commits, bump version, publish, write changelog.semantic-release --dry-run: Preview what would be released: no side effects.release-please (Google): Alternative release automation: PR-based version bumps.git commit -m "feat: ..." (atomic): One concern per commit: small, reviewable history.Frequently asked questions
What is a conventional commit?
A commit message format with a structured prefix: type(scope): description, for example feat(api): add rate limiting. Types include feat, fix, docs, style, refactor, test, and chore, which drive automatic versioning and changelogs.
When should I use a breaking change?
Use the ! marker or BREAKING CHANGE footer when your commit requires consumers to change their code or configuration. Semantic-release then bumps the major version automatically instead of minor or patch.
Which tools enforce conventional commits?
commitlint validates messages in CI, husky runs it as a pre-commit hook, and semantic-release derives versions and changelogs from commit types. They work together to keep history consistent.