Gerrit 提示冲突,不能合并代码(git解决远程冲突)(转)
1.Gerrit里点击“publish and submit”提示如下:
| Gerrit Code Review | 10:57 AM |
Your change could not be merged due to a path conflict.
Please merge (or rebase) the change locally and upload the resolution for review.
2.解决方法如下:
- cd ~/projects/pan #切换到pan项目
- git branch #查看分支情况
- git checkout master #选择分支
- git fetch origin #fetch与pull的区别,自己再搜吧~
- git rebase origin/master #查看有“CONFLICT (content): ”的地方,手工解决冲突后,下一步
- git add dev/controller/web/index.php #这只是一个举例,即要先add操作
- git rebase --continue
- git push origin HEAD:refs/for/master #OK了
git push后,你需要在Gerrit里面再次review一次。
3.本文参考博客:《Git,Gerrit,hudson(3)--git技巧总结》
虽然对git还是有些疑惑,anyway,冲突的问题还是解决了。

浙公网安备 33010602011771号