commit-msg 在commit-msghooks 中,我们需要对 commit 消息和用户进行校验。 #!/bin/sh# 用 `` 可以将命令的输出结果赋值给变量# 获取当前提交的 commit msgcommit_msg=`cat $1`# 获取用户 emailemail=`git config user.email`msg_re="^(feat|fix|docs|style|refactor|perf|test|workflow|build|ci|chore|...
安装好以上依赖之后,可以在本地测试是否生效 echo "test(xxx): add test" | npx commitlint 配置 husky:"husky": { "hooks": { "pre-commit": "npm run test", "commit-msg": "commitlint -e $GIT_PARAMS" // 或者 "commitlint -E HUSKY_GIT_PARAMS" }},这样就能对 commit 信息进行 ...
为了拦截不规范的 commit msg,需要利用 git hooks 的commit-msg自动执行 commitlint "gitHooks": { "commit-msg": "commitlint -e $GIT_PARAMS" } 乱输入一个 commit msg 试试,发现非常神奇。卡控生效了 按照以上步骤就可以规范你们团队的 commit msg了。 总结一下: step 1: 安装依赖 npm install -D comm...
上面这个情况主要针对本地刚下载的仓库,第一次提交会出现这个情况,只需要执行一次,以后再该仓库提交就不用执行了,说白了就是这个commit-msg是局部的,只对当前仓库生效。 还有另外一种情况,也是大家遇到比较多的,就是执行了上面的命令,再push时还是一样的错,这个时候,你就要检查下是否其他提交没有change_id,因为ge...
"scripts":{"commit":"git-cz"},"husky":{"hooks":{"commit-msg":"commitlint -E HUSKY_GIT_PARAMS"}},"config":{"commitizen":{"path":"./node_modules/cz-conventional-changelog"}} 在项目根目录下创建commitlint.config.js: module.exports= {extends: ["@commitlint/config-conventional"] ...
浪遏飞舟 关注作者注册登录 浪遏飞舟 1.9k声望4.5k粉丝 « 上一篇 Lerna --多包存储管理工具 下一篇 » React组件应用于Spring MVC工程 引用和评论
描述经常会遇到提交多个commit ,最后发现版本有问题,需要删除中间的一个commit, git 中并没有提供现成的命令,需要多个命令组合完成该功能...实现首先用git format-patch -n -m,生成n-m个补丁文件 000(n-m)-commit-msg.patch, git reset –...
工具生效都需要执行 source ~/.zshrc 4.使用方法 在终端输入 gcmm 后,使用 Tab 键选择 commit 类型,然后输入提交信息 gcmm-xxx msg1 msg2 ... 当msg 参数多于一个时,信息会按照列表提交,如 xxx 1.msg1; 2.msg2. 除了gcmm-tmp,其他命令必须包含提交信息 ...
清晰,直观 我们的changelog可以直接通过指令生成 完整格式如下:<type>(<scope>): <subject> <BLANK ...
enable_rich_error_msg enable_rootservice_standalone enable_rpc_authentication_bypass enable_separate_sys_clog enable_smooth_leader_switch enable_sql_audit enable_sql_operator_dump enable_sys_table_ddl enable_sys_unit_standalone enable_syslog_recycle enable_syslog_wf enable_tcp_keepalive enable_upgrade...