Skip to content

Instantly share code, notes, and snippets.

@gabrielecanepa
Created October 19, 2023 15:31
Show Gist options
  • Save gabrielecanepa/fa6cca1a8ae96f77896fe70ddee65527 to your computer and use it in GitHub Desktop.
Save gabrielecanepa/fa6cca1a8ae96f77896fe70ddee65527 to your computer and use it in GitHub Desktop.
The Conventional Commits ultimate cheatsheet.

Conventional Commits

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

Quick examples

feat: new feature
fix(scope): bug in scope
feat!: breaking change`
feat(api)!: rework API
chore(deps): update dependencies

Specification

Types

  • feat: a new feature, correlates with MINOR in SemVer
  • fix: a bug fix, correlates with PATCH
  • chore: changes not related to the source code or tests (e.g. build process, auxiliary tools, libraries)
  • build: changes that affect the build system or external dependencies (eg. gulp, webpack, npm)
  • ci: changes to CI configuration files and scripts (e.g. travis, circle, browserstack)
  • docs: changes related only to the documentation
  • perf: code change that improves performance
  • refactor: generic code change that neither fixes a bug nor adds a feature
  • revert: change reverting a previous edit
  • style: changes that don't affect the meaning of the code (e.g. white-space, formatting, missing semi-colons)
  • test: adding missing tests or correcting existing ones

BREAKING CHANGE

A commit that has a BREAKING CHANGE footer, or appends a ! after the type and scope, introduces a breaking API change. A breaking change can be part of commits of any type and relates to MAJOR in Semantic Versioning.

Footer

Footers other than BREAKING CHANGE: <description> may be provided and follow a convention similar to git trailer format.

Examples

Commit message with description and BREAKING CHANGE footer

feat: allow provided config object to extend other configs

BREAKING CHANGE: `extends` key in config file is now used for extending other config files

Commit message with ! to draw attention to the breaking change

feat!: send an email to the customer when a product is shipped

Commit message with a scope and ! to draw attention to breaking change

feat(api)!: send an email to the customer when a product is shipped

Commit message with both ! and BREAKING CHANGE footer

chore!: drop support for Node 6

BREAKING CHANGE: use JavaScript features not available in Node 6.

Commit message with no body

docs: correct spelling of CHANGELOG

Commit message with scope

feat(lang): add Polish language

Commit message with multi-paragraph body and multiple footers

fix: prevent racing of requests

Introduce a request id and a reference to latest request. Dismiss
incoming responses other than from latest request.

Remove timeouts which were used to mitigate the racing issue but are
obsolete now.

Reviewed-by: Z
Refs: #123

References

More details and examples at conventionalcommits.org.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment