Conventional commit is an awesome way to build professional and clean Git history.

Why You Must Use Conventional Commits

  • CHANGELOGs are automatically generated.
  • Explaining changes to collaborators and other stakeholders.
  • Triggering build processes.
  • Structured commit history.

You can learn more on the conventional commits guidelines and https://github.com/commitizen/cz-cli.

Conventional commit messages structure

<type>[optional scope]: <description>

[optional body]

[optional footer(s)]

How to use conventional commits

Install commitizen

You can use npm to install commitizen. Here is how:

As global utility

  1. Be sure to have npm or Install it.
  2. In your terminal, run: npm install -g commitizen
  3. After that, run: npm install -g cz-conventional-changelog
  4. For Windows users, go to C:\Users\%USERNAME% and create a file .czrc
  5. For MacOs users, go to ~/ and create a file .czrc

    or just run: echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc

  6. Add the following code

{ "path": "cz-conventional-changelog" }

Now you are ready to read an apply our article on Git Workflow, or use Gitlab with Git.

Related Articles

Written by

Albert Oplog

Hi, I'm Albert Oplog. I would humbly like to share my tech journey with people all around the world.