Skip to content

Instantly share code, notes, and snippets.

@eynopv
Created March 31, 2022 09:46
Show Gist options
  • Save eynopv/4826809e088bb12a94d7636e1b121a72 to your computer and use it in GitHub Desktop.
Save eynopv/4826809e088bb12a94d7636e1b121a72 to your computer and use it in GitHub Desktop.
Conventional Commits

Conventional Commits

Be better programmer through better commits.

Structure

<type>(<optional scope>): <summary in present tence>

<optional body>

<optional footer>

Types

Must be one of those:

  • feat: new feature
  • fix: bug fix
  • perf: code change that improves performance
  • refactor: change of code structure but not functionality
  • style: code style change (whitespace, missing semicolon, etc.)
  • test: adding missing test or fixing existing one
  • chore: commit which does not affect the code, for example package update
  • docs: change to documentation

Scope

Scope is application specific.

Examples of scope can be:

  • app
  • api
  • router
  • runner
  • etc.

Examples

  • feat(api): allow creation of foo with bar
  • fix: prevent duplication of data
  • perf: use for loop instead of forEach
  • refactor: separate creation of record into creation and validation
  • style: add missing semicolon
  • test: add test for foo
  • chore: bump version of x package

Breaking Changes and Commits With Increased Attention

Use BREAKING CHANGE: <description> footer to describe the breaking change or give information on what has to be done.

Use ! after optional scope to bring attention to the change.

! and BREAKING CHANGE footer can be used together

chore(api)!: drop support for version X

BREAKING CHANGE: use functions only available after version X

References

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