2011年12月11日 星期日

Your change could not be merged due to a path conflict

 


使用git 上傳程式到Gerrit Code Review時,如果在你push之前,已經有人先插隊push,並且也merge進去了,


這時候如果要merge程式,就會出現這樣的訊息:


Your change could not be merged due to a path conflict.


Please merge (or rebase) the change locally and upload the resolution for review.


 


這是因為你的基礎(base)比較舊,而別人的base是新上去的,是最新的,


解決的方法就是要更新你的base,指令如下:


git pull --rebase


然後查看有無衝突(conflict),


沒有的話,就可以下:


git push ssh://myname@myserver.com.tw:29418/myproject HEAD:refs/canges/changeID


 


之後在gerrit再merge一次,就能進去了。