The git commit message is very important. You can use commit message to generate
CHANGELOG in your ci pipeline Or any you want to do something.
So, We can standardize standard commit message for you or your team.
We can help ourselves to write beautiful message through some tools.
brew install commitizen pre-commit
The template include three part,
- feat: A new feature
- fix: A bug fix
- docs: Documentation only changes
- style: Changes that do not affect the meaning of the code (white-space, formatting, missing semi-colons, etc)
- refactor: A code change that neither fixes a bug nor adds a feature
- perf: A code change that improves performance
- test: Adding missing tests or correcting existing tests
- build: Changes that affect the build system or external dependencies (example scopes: gulp, broccoli, npm)
- ci: Changes to our CI configuration files and scripts (example scopes: Travis, Circle, BrowserStack, SauceLabs)
- chore: Other changes that don’t modify src or test files
- revert: Reverts a previous commit
Body: 72-character wrapped.
- The body is a detailed description of this submission, which can be multiple lines, and each line should not exceed 72
- Explain the items and reasons of the code changes, as well as the comparison with the previous behavior
- Fill in the task number (if any)
- BREAKING CHANGE (can be ignored), record incompatible changes, start with BREAKING CHANGE:, followed by a description
of the change, the reason for the change, and the migration method.
Create a file call
Set git config template location
git config --global commit.template ~/.gitmessage.txt
pre-commit to standardize commit message when git commit.
And then you should get two files
You can create a new tag via
cz bump or other commands.
usage: cz [-h] [--debug] [-n NAME]