git push 报错:missing Change-Id in commit message footer
使用gerrit后,提交代码会出现如下截图问题:
临时解决:
step1:把上面红色的那条gitidir复制下来执行下:
step2:执行下面的命令会添加change_id
git commit --amend
step3:然后推送代码到服务器上
git push origin HEAD:refs/for/$branch_name
上面这个情况主要针对本地刚下载的仓库,第一次提交会出现这个情况,只需要执行一次,以后再该仓库提交就不用执行了,说白了就是这个commit-msg是局部的,只对当前仓库生效。
还有另外一种情况,也是大家遇到比较多的,就是执行了上面的命令,再push时还是一样的错,这个时候,你就要检查下是否其他提交没有change_id,因为gerrit要求每个提交都要有change_id。
举例:
执行git log 看到类似如下现象:
从上而下,我们用commitid1,commitid2,commitid3表示截图中的三个提交,很明显,第二个提交commitid2没有change_id,这个时候我们可以git reset --soft commitid3来软回退到异常节点的前一个正常的节点,这个操作相当于撤销了最后的git commit -s的操作,add过的代码还在索引库(可以去了解下git reset --soft),具体操作如下:
(1) git reset --soft commitid3
(2) git status 可以看到绿色的已经add过的文件(即commitid1和commitid2的改动)
(3) git commit -s #添加评论,保存退出后会生成change_id
(4) git log 可以看到已经有了change_id
(5) git push origin HEAD:refs/for/工作分支
我的具体操作如下,供参考:
参考:
https://blog.csdn.net/u012843873/article/details/82424514
该博客中还介绍了第三种方式使用交互式 rebase 找回任意提交位置的 Change-Id ,git rebase -i commitid3,然后参考如下:
其中还介绍了change-ID相关信息,钩子之类的,详细内容见参考链接。
git push 报错:missing Change-Id in commit message footer的更多相关文章
- git push报错大文件,删除后重新commit依然报错
git push报错: github不能上传大文件,按道理删掉重新提交就行了 可是删掉后,git add -A,再git commit,再git push,依然报错 后来我想明白了 github上传时 ...
- git push报错error: failed to push some refs to 'git@github.com'
git push报错error: failed to push some refs to 'git@github.com' $ git push -u origin master To git@git ...
- git push 报错
git push报错误: Git push error: RPC failed; result=56, HTTP code = 200 fatal: The remote end hung up un ...
- 电脑修改密码后,git push 报错unable to access
电脑修改密码后,git push 时报错 remote: Permission to xxx A. fatal: unable to access 解决这个问题有两种方法,一种是界面修改,一种是命令 ...
- git push 报错 "Peer certificate cannot be authenticated with known CA certificates"
使用git push -u origin master 命令向远程仓库提交代码时报错:Peer certificate cannot be authenticated with known CA ce ...
- 解决git push报错error: failed to push some refs to 的问题
这个问题发生的背景一般是: 想把自己本地的某个项目关联到远程仓库并推送上去,接着他会做如下操作: 本地项目->远程创建仓库->本地关联远程->推送最新代码 最后一个步骤发生问题: 那 ...
- git push 报错:failed to push some refs to 'git@git.xxxx:devops/thor.git'
error: failed to push some refs to 'git@git.caicaivip.com:devops/thor.git' hint: Updates were reject ...
- git push报错
git: No refs in common and none specified; doing no (2012-10-28 11:43:10) 转载▼ 标签: 杂谈 分类: 项目管理 用gitol ...
- 由于github仓库中提前建立readme文件,导致git push报错error: failed to push some refs to 'git@github.com:
$ git push -u origin master To git@github.com:xxx/xxx.git ! [rejected] master -> master (fetch fi ...
随机推荐
- Django详解之models操作
D jango 模型是与数据库相关的,与数据库相关的代码一般写在 models.py 中,Django 支持 sqlite3, MySQL, PostgreSQL等数据库,只需要在settings.p ...
- 10.4ORM回顾!
2018-10-4 17:41:52 继续优化一下我的博客项目!! 贴上orm参考连接:https://www.cnblogs.com/yuanchenqi/articles/8963244.html ...
- 6.29一个_rcv 面试题
#coding:utf-8 #2018-6-29 16:30:34 #类调用属性,属性没有,用__getatrr__魔法方法! #目的打印出 think different itcast class ...
- AngularJS快速教程
作者:arccosxy 转载请注明出处:http://www.cnblogs.com/arccosxy/ AngularJS是Google开源的一款JavaScript MVC前端框架,弥补了HTM ...
- DB2 Version 10.5 补丁下载
DB2 Version 10.5 for Linux, UNIX, and Windows fix pack summary https://www.ibm.com/support/knowledge ...
- ubuntu16.04安装kinetic调用gazebo_control解决方案
解决方案 sudo apt-get install ros-kinetic-gazebo-ros-control
- sql join 语句的小总结
CREATE TABLE Persons ( id INT PRIMARY KEY, LastName CHAR() NOT NULL, FirstName VARCHAR (), address V ...
- [No000012F]WPF(7/7) - 样式,触发器和动画
WPF Tutorial : Beginning [^] WPF Tutorial : Layout-Panels-Containers & Layout Transformation [^] ...
- 批量kill java进程方法-引出子shell和反引用
方法: kill –9 `pgrep java` 使用上述命令可以将服务器上运行的所有java进程一次性kill掉. 扩展:子shell和反应用在shell脚本中的作用 先来看一个子shell的例子: ...
- Mac操作的一些技能
截图功能 通常会用到以下快捷键组合: Command+Shift+3截全屏. Command+Shift+4截屏幕选定部分. Command+Shift+4+空格截取所选窗口 在终端输入如下命令,开启 ...