git推送push代码到远程仓库报错:missing Change-Id in commit message footer,缺失Change-Id

git推送push代码到远程仓库报错:missing Change-Id in commit message footer,缺失Change-Id

原因是gerrit提交代码需要Change-Id。

解决方案:

(1)一般各家公司会搭建自己的gerrit服务器,比如google的:

https://gerrit-review.googlesource.com/tools/hooks/commit-msg

把https://gerrit-review.googlesource.com换成自家的gerrit链接地址,然后访问拼接在一起的地址,http://xxx.xxx.xxx/tools/hooks/commit-msg,下载一个 commit-msg 文件。

(2)把commit-msg文件放在项目代码目录\.git\hooks目录下。

(3)执行命令:

git commit --amend

在出现的窗口直接输入

:wq

(4)再次推送:

git push origin HEAD:refs/for/远程分支名

git回退代码仓库版本_代码 退出当前仓库_zhangphil的博客-CSDN博客git回退代码版本https://blog.csdn.net/zhangphil/article/details/125624513

git代码回滚_zhangphil的博客-CSDN博客git代码回滚到历史上的某一次提交。git命令:git reset --hard <commit-id>commit-id可以通过git log输出查找。然后强制推送到远程:git push --force https://blog.csdn.net/zhangphil/article/details/80234273

git删除/撤销远已经push到程服务器上某次代码提交_git删除某次push_zhangphil的博客-CSDN博客git删除/撤销远已经push到程服务器上某次代码提交场景:不小心把一次错误的代码push到远程服务器上的分支上,需要立即删除/撤销这次代码提交。具体方法,git命令:git reset --hard git push origin HEAD --forcecommit_id可以通过git命令:git log输出获取。commit_id形如:126f206185f225879f2723ca421https://blog.csdn.net/zhangphil/article/details/79670257

你可能感兴趣的:(git,git)