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.解决方法如下:

 

  1. cd ~/projects/pan   #切换到pan项目  
  2. git branch   #查看分支情况  
  3. git checkout master  #选择分支  
  4. git fetch origin  #fetch与pull的区别,自己再搜吧~  
  5. git rebase origin/master  #查看有“CONFLICT (content): ”的地方,手工解决冲突后,下一步  
  6. git add dev/controller/web/index.php #这只是一个举例,即要先add操作  
  7. git rebase --continue  
  8. git push origin HEAD:refs/for/master    #OK了  

 

 

git push后,你需要在Gerrit里面再次review一次。

 

3.本文参考博客:《Git,Gerrit,hudson(3)--git技巧总结》

虽然对git还是有些疑惑,anyway,冲突的问题还是解决了。

posted @ 2015-02-11 13:09  邹邹  Views(2670)  Comments(0)    收藏  举报