公司的git环境 需要把代码提交后评审分支,
git push origin HEAD:refs/for/dev
出现missing change-id的问题
解决方法1:
remote: gitdir=$(git rev-parse --git-dir); scp -p -P 29418 ****@*******:hooks/commit-msg ${gitdir}/hooks/ remote: and then amend the commit: remote: git commit --amend --no-edit remote: Finally, push your changes again
先执行gitdir=$(git rev-parse --git-dir); scp -p -P 29418 ****@*******:hooks/commit-msg ${gitdir}/hooks/
这是一个远程拷贝命令:把commit-msg文件拷贝到本地的.git/hooks目录下 通过这个脚本生成change-id的
如果这句执行没问题,那最好了,
但我公司git服务器为了安全,限制了scp,也就是git服务器拒绝访问,那就要浏览器输入:http://*****.com/tools/hooks/commit-msg
就会从git服务器上下载commit-msg文件,再把文件拷贝到.git/hooks目录下 再执行
git commit --amend --no-edit
再重新git add .
git commit -m '注释
git push origin head:refs/for/dev
如果还是有问题,重新下载代码,把commit-msg文件拷贝到.git/hooks目录下,再新增代码并执行上述脚本。