Introduction

Leaving a meaningful commit can be useful for when:

  1. working with group of people
  2. you want to refresh your memories in future

Recently, I started using conventional commit coupled with tools such as commitlint and commitizen. Conventional commit allows for auto generation of changelog through tools like release-please in github action

Conventional Commit

In commitizen, they offer following commit types to choose from:

TypeDescription
featA new feature
fixA bug fix
docsDocumentation only changes
styleChanges that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
refactorA code change that neither fixes a bug nor adds a feature
perfA code change that improves performance
testAdding missing tests or correcting existing tests
buildChanges that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
ciChanges to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
choreOther changes that don't modify src or test files
revertReverts a previous commit

Here's the format:

<type>(<scope>): <subject>

Here's some example:

  • feat(navbar): changed color of navbar
  • docs: added contributor list to README
  • chore(deps) Update all non-major dependencies

Still, I wasn't entirely sure when to use which commit type and scope. For now, I'm looking at other open source projects and learning from their examples.