
Conventional Commits - Types Cheat Sheet
- Tech |
- 03 Feb 2021 |
- 02 Mins read
Types as prefix in conventional commits, are used to set the overall context of the applied changes in a commit message. With a type, a viewer should be able to quickly understand what the intention of the commit is. So e.g. is it a new feature or some documentation that is added with a particular commit. It often happens to me, that I am unsure which type in particular I finally shall use in my commit messages. The conventional commits formatting, is heavily inspired by the Angular commit message guidelines. I have collected a few types so far and put together a small cheat sheet in the table below with some common examples. All you have to do is, to find a proper description for your specific commits. For doing so, ask yourself the following question: What will my commit do once it is applied?
Syntax | Description | Example |
---|---|---|
feat | addition of some new features | add a new navbar |
add | changes to add new capability or functions | add google track id |
blog | new blog post | add a new blog post |
cut | removing the capability or functions | remove tags |
fix | a bug fix | fix layout issue |
bump | increasing the versions or dependency versions | update cypress-axe |
build | changes to build system or external dependencies | switch from npm to yarn |
make/ops | change to the build process, tooling, infra, deploy, recovery | add sonarqube config |
ci | changes to CI configuration files and scripts | add new ci stage |
doc | changes to the documentation | update README |
test | adding missing tests or correcting existing tests | add a first test |
chore | changes for housekeeping/cleanup | remove unused files |
refactor | a code change/cleanup that neither fixes a bug nor adds a feature | cleanup abstact class Cat |
style | changes to the code that do not affect the meaning | brush up main page |
optimize/perf | a code change that improves performance | reduce image sizes |
revert | reverting an accidental commit | revert dependency update |
I hope you can use some things from this cheat 🗒️ in your daily commit life.
Cheers, take care and smile once in a while 🙂