安装commitizen

1.windows 全局安装commitizennode模块

npm install -g commitizen@4.2.4

注意:一定要在当前windows用户下全局安装,不是在项目内安装

2.在需要使用Commitizen规范的项目内执行

注意前提该项目根目录上已有package.json文件

commitizen init cz-conventional-changelog --save --save-exact
or
commitizen init cz-conventional-changelog --save --save-exact --force

安装成功后检查package.json文件,如新增以下配置代表安装成功

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

测试命令

git cz

显示(成功):

cz-cli@4.2.4, cz-conventional-changelog@3.3.0? Select the type of change that you're committing: (Use arrow keys)
> feat:     A new featurefix:      A bug fixdocs:     Documentation only changesstyle:    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 featureperf:     A code change that improves performancetest:     Adding missing tests or correcting existing tests
(Move up and down to reveal more choices)


本文来自互联网用户投稿,文章观点仅代表作者本人,不代表本站立场,不承担相关法律责任。如若转载,请注明出处。 如若内容造成侵权/违法违规/事实不符,请点击【内容举报】进行投诉反馈!

相关文章

立即
投稿

微信公众账号

微信扫一扫加关注

返回
顶部