Front-end git submission specification (git cz)

sequence:

Recently, when submitting the code, I found that the code description of each submission is uneven, which makes people feel particularly messy. First: It makes people feel that this programmer does not seem to have a "regular" background, and then let himself have no clue when backtracking the code.

install commitizen

npm install commitizen
yarn add commitizen

configuration command

After the installation is complete, add the following command under the package.json folder of the corresponding project:

"config": {
    
    
  "commitizen": {
    
    
    "path": "./node_modules/cz-conventional-changelog"
  }
}

insert image description here
After adding, enter the git cz command in the control panel, and the corresponding commitizen submission specification steps will appear as follows:

git cz
? Select the type of change that you're committing: (Use arrow keys)
❯ 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 

feat: A new feature
壮举:新功能

fix: A bug fix
修复:错误修复

docs: Documentation only changes
docs:仅文档更改

style: Changes that do not affect the meaning of the
样式:不影响代码含义的更改(空格、格式、缺少分号等


refactor: A code change that neither fixes a bug nor
重构:既不修复错误也不添加功能的代码更改


perf: A code change that improves performance
perf:提高性能的代码更改


test: Adding missing tests or correcting existing tests
测试:添加缺失的测试或纠正现有的测试

build: Changes that affect the build system or external dependencies
build:影响构建系统或外部依赖项的更改

ci: Changes to our CI configuration files and scripts
ci:对我们的 CI 配置文件和脚本的更改

chore: Other changes that dont modify src or test
杂项:不修改 src 或测试文件的其他更改

revert: Reverts a previous commit
还原:还原以前的提交

If you modify the bug, the first step is to select the fix option: fix

In the second step, a Specify a scope will appear: it means that the modified folder is that part. I usually choose src/home/banner... etc. These folders can choose the changed directory

In the third step, there will be write a short description: it means to write a short description. I usually: modify...bugs, etc.

For the rest of the options, you can press Enter directly. The final commitizen information is: fix(src/home/banner): Modified...bug. Doesn't it look very clear!

Guess you like

Origin blog.csdn.net/MoXinXueWEB/article/details/128096189