Each commit message consists of a header, a body, and a footer.
<type>(<scope>): <subject>
<BLANK LINE>
<body>
<BLANK LINE>
<footer>
Header
The header is mandatory and the scope is optional.
Type
Must be one of the following:
feat
: introduces a new feature to the codebasefix
: patches a bug in your codebaserefactor
: improves the code without changing functionalityBREAKING CHANGE
: major version
Additional types:
build
: a change that affects the build system or external dependencieschore
: same asbuild
butchore
is preferred, also any change that doesn’t fit in any other typeci
: changes to the CI configurationdocs
: changes to the documentationstyle
: white-space, formatting, semi-colons, etc.perf
: performance improvementstest
: adding or fixing
Scope
The scope can be empty. Scope can be any of these:
- category, part or section of the codebase we are affecting, e.g.:
api
,client
,tooling
- a specific package, library or dependency,e.g.:
moment.js
,requests
- a ticket number in case the current commit doesn’t close it, e.g.:
chore(123): update dependencies
Subject
Short (50 chars or less) summary of the change:
- use the imperative, present tense: “change” not “changed”
- don’t capitalize the first letter
- no dot (.) at the end
Footer
The footer should contain a closing reference to an issue if any and breaking changes.
Closes #123, #345
BREAKING CHANGE:
IE6 not supported anymore.
Semantic versioning
Conventional commits are designed to work with Semantic versioning.
feat
: minor versionfix
: patch versionBREAKING CHANGE
: major version
Examples
Add a new feature without breaking existing functionality. This bumps a minor version, e.g.: 1.2.0
to 1.3.0
.
feat: add search for transactions
Add new React component for searching transactions with autocompletion.
Include tests.
Closes #123, #234
Fix a bug. This bumps a patch version, e.g.: 1.3.0
to 1.3.1
.
bug(api): add correct status code for existing resources
We return `409` when trying to create a user with an existing email.
Closes #453
Add new feature that breaks existing functionality. This bumps a major version, e.g.: 1.3.1
to 2.0.0
.
feat!: add bank sync
This replace CSV import and use Plaid to connect to people's banks.
Closes #423, #424, #425
BREAKING CHANGE:
People won't be able to import transactions using CSV. Only Bank
Sync is available.
Resources
- Angular Commit Message Guidelines
- Do new features, updates, design use feat: in semantic commit message convention? (Stack Overflow)
- Karma commit message
- A Note About Git Commit Messages (Tim Pope)
- Semantic Commit Messages (Sparkbox)
- How can I write good Conventional Commit-style commit messages for one feature over multiple commits? (Stack Exchange)
- Conventional Commits
Leave a Reply