It is a good idea to standardize our git commit messages when we work in a team so that it is easier to check the flow of the project. One way to ensure that is using
commitizen.
Detailed installation and usage
instructions can be found on github README.
In short,
npm install -g commitizen
npm install -g cz-conventional-changelog
echo '{ "path": "cz-conventional-changelog" }' > ~/.czrc
Now, in any git repo directory,
git add the files that we want to commit. Then, use
git cz to commit.
We can see a similar prompt like below which we will then type in our commit message and fill out a small questionnaire.
 |
Commitizen git cz commit types |
 |
Commitizen git cz commit flow |
You will have a consistent format of commit messages for your group projects.
Thank you for reading!
Jun
Comments
Post a Comment