1.简介
commitizen是git提交信息的一种消息模式,同时也是规范我们git提交记录,用git cz代替git commit
2.安装
在项目安装里conventional-changelog依赖
yarn global add commitizen
yarn add cz-conventional-changelog -D
3.配置项目里package.json
"config": {
"commitizen": {
"path": "./node_modules/cz-conventional-changelog"
}
},
4.使用git cz
做完以上,你就可以使用git cz了
git add .
git cz
git push
5.tpye
feat:新功能(feature)
fix:修补bug
docs:文档(documentation)
style:格式(不影响代码运行的变动)
refactor:重构(即不是新增功能,也不是修改bug的代码变动)
perf:提高性能的代码更改
test:增加测试
build:影响构建系统或外部依赖项的更改(示例范围:gulp、broccoli、npm)
ci:对ci配置文件和脚本的更改(示例范围:Travis, Circle, BrowserStack, SauceLabs)
chore:构建过程或辅助工具的变动
revert: 恢复以前的提交(回退)
web职场小明,写的不好的地方请多多包涵