主页 > 开源代码  > 

git提交管理

git提交管理
git提交管理 scoop install nodejs # windows npm install --save-dev @commitlint/config-conventional @commitlint/cli # non-windows npm install --save-dev @commitlint/{cli,config-conventional} # windows将commitlint.config.js修改为utf8编码, 默认utf16编码 echo "export default { extends: ['@commitlint/config-conventional'] };" > commitlint.config.js # 安装hook工具 npm install --save-dev husky npx husky init # Add commit message linting to commit-msg hook echo "npx --no -- commitlint --edit \$1" > .husky/commit-msg # Windows users should use ` to escape dollar signs echo "npx --no commitlint --edit `$1" > .husky/commit-msg # Test simple usage npx commitlint --from HEAD~1 --to HEAD --verbose 测试

一定会报错的git提交

git commit -m "foo: this will fail" # husky > commit-msg No staged files match any of provided globs. ⧗ input: foo: this will fail ✖ type must be one of [build, chore, ci, docs, feat, fix, perf, refactor, revert, style, test] [type-enum] ✖ found 1 problems, 0 warnings ⓘ Get help: github /conventional-changelog/commitlint/#what-is-commitlint husky - commit-msg script failed (code 1) reference commitlint
标签:

git提交管理由讯客互联开源代码栏目发布,感谢您对讯客互联的认可,以及对我们原创作品以及文章的青睐,非常欢迎各位朋友分享到个人网站或者朋友圈,但转载请说明文章出处“git提交管理