最后,当时查看提交历史时,你会看到这样的commit message: docs(docs): 更新README文件 2、validate-commit-msg插件 commitizen 可以保证自己本地的commit message规范,但是无法保证队友也是规范的,所以需要其他工具来检测队友的提交记录是否规范。使用validate-commit-msg 检查队友的commit message规范 #安装 $ npm install...
"husky": {"hooks": {"commit-msg":"commitlint -e$GIT_PARAMS"} } 然后我们正常操作git gitadd. gitcommit-m "test" 上面message不符合提交规范,所以会报错如下: 起到了校验的作用。 四、生成Change Log 如果你的所有 Commit 都符合 Angular 格式,那么发布新版本时, Change log 就可以用脚本自动生成 生成...
"commit-msg": "commitlint -e $GIT_PARAMS" } } 自动化生成 变更日志(Changelog) [conventional-changelog-cli](conventional-changelog/packages/conventional-changelog-cli at master · conventional-changelog/conventional-changelog (github.com)) 默认推荐的 commit 标准是来自 angular 项目,除了 angular 标准以外...
如果当前的 commit 是还原到之前的 commit,那么当前 Commit msg Header 要以revert:开头,并且后面紧跟着还原 Commit 的 Header 。这时 Body 里面要以This reverts commit <hash>固定式,其中<hash>是 commit 的 SHA 标示符。 revert: feat(pencil):add'graphiteWidth'option This reverts commit667ecc1654a317a13...
git commit msg 规范 Subject 一句话概述 commit 主题(必须) Body 详细描述 What 和 Why (可选) Footer 不兼容或关闭 issue 等说明(可选) Subject 主题(Subject)是 commit 的简短描述,不超过 50 个字符。 用一句话说明本次所作的提交, 如果一句话说不清楚,那有可能这个提交得拆分成多次 主要采用...
"husky": { "hooks": { "pre-commit": "npm run test", "commit-msg": "commitlint -e $GIT_PARAMS" // 或者 "commitlint -E HUSKY_GIT_PARAMS" }},这样就能对 commit 信息进行 lint 了。8. 根据 commit 信息自动生成 CHANGELOG conventional-changelog-cli 文档 conventional-changelog-cli...
1. 规范 Commit Msg 的作用 1) 提供更多的历史信息,方便快速浏览 例如,命令显示上次发布后的变动,每个 commit 占据一行。只看首行,就知道某次 commit 的目的。 $ git log <last tag> HEAD --pretty=format:%s 2) 可以过滤某些 commit ,便于快速查找信息 ...
"commit": "git-cz" }, "config": { "commitizen": { "path": "./node_modules/cz-conventional-changelog" } } 1. 2. 3. 4. 5. 6. 7. 8. 9. 自定义 Adapter 如果Angular 的规范不符合我们的实际,同样我们也可以通过cz-customizable定制一套符合自己或者团队的规范。
在日常的开发工作中,我们通常使用 git 来管理代码,当我们对代码进行某项改动后,都可以通过 git commit 来对代码进行提交。 git 规定提交时必须要写提交信息,作为改动说明,保存在 commit 历史中,方便回溯。规范的 log 不仅有助于他人 review, 还可以有效的输出 CHANGELOG,甚至对于项目的研发质量都有很大的提升。