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
- Be sure to have npm or Install it.
- In your terminal, run:
npm install -g commitizen
- After that, run:
npm install -g cz-conventional-changelog
- For Windows users, go to
C:\Users\%USERNAME%
and create a file.czrc
- For MacOs users, go to
~/
and create a file.czrc
or just run:
echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc
-
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.
[…] you are ready to read an apply our article on Conventional Commit with Git, or use Gitlab with […]
[…] you are ready to read an apply our article on Conventional Commit with Git, or use Gitlab with […]
[…] Git and Conventional Commit […]