conventional commits cheatsheet

Commit Message Formats

Standard Format

<type>(<optional scope>): <description>
empty separator line
<optional body>
empty separator line
<optional footer>

Initial Commit

chore: initial commit

Types

  • API relevant changes:
  • feat: Commits that add or remove a new feature.
  • fix: Commits that fix a bug.
  • refactor: Commits that restructure or rewrite code without changing behavior.
  • perf: Special refactor commits that improve performance.
  • style: Commits that do not affect functionality (e.g., whitespace, formatting, missing semi-colons).
  • test: Commits that add missing tests or correct existing tests.
  • docs: Commits that affect documentation only.
  • build: Commits that impact build components such as build tools, CI pipelines, dependencies, versioning.
  • ops: Commits that affect operational components like infrastructure, deployment, backups, recovery.
  • chore: Miscellaneous commits, like updating .gitignore.

Scopes

The scope provides additional context.

  • Is an optional part of the format.
  • Allowed scopes depend on the project.
  • Avoid using issue identifiers as scopes.

Breaking Changes Indicator

Indicate breaking changes with an ! before the : in the subject line, e.g., feat(api)!: remove status endpoint.

  • Is an optional part of the format.

Description

The description is a concise summary of the change.

  • Is a mandatory part of the format.
  • Use the imperative, present tense: "change" not "changed" or "changes."
  • Think of This commit will... or This commit should....
  • Don’t capitalize the first letter.
  • No period (.) at the end.

Body

The body explains the motivation for the change and how it contrasts with previous behavior.

  • Is an optional part of the format.
  • Use the imperative, present tense: "change" not "changed" or "changes."
  • This is where issue identifiers and references should be mentioned.

The footer includes any Breaking Changes information and references issues.

  • Is an optional part of the format.
  • Optionally reference an issue by its ID.
  • Breaking Changes must start with BREAKING CHANGES: followed by a space or two newlines, with details in the rest of the message.

Examples

feat: add gluten - free pizza option to the menu
feat(menu): add "add extra toppings" button for salads
feat!: remove tomato soup from the specials menu
refers to JIRA-1337
BREAKING CHANGES: tomato soup has been removed from the menu.
style: remove extra spaces in the recipe instructions

References