The change cannot be merged due to a path conflict. Rebase the change and upload the rebased commit for review

3,528 views
Skip to first unread message

Mohan Kumar

unread,
May 8, 2018, 7:39:34 AM5/8/18
to Repo and Gerrit Discussion

Gerrit Version-2.14.7

Git Client Version-2.17

Problem:

One of our user successfully got reviewed his code with (Code Review +2), then when he tried to submit the review request, it shows below message on gerrit GUI.

The change cannot be merged due to a path conflict. Rebase the change and upload the rebased commit for review.

Can someone guide me to resolve the same.

Matthias Sohn

unread,
May 8, 2018, 8:23:23 AM5/8/18
to Mohan Kumar, Repo and Gerrit Discussion
did you try what the error message told you to do ? This error is raised if another change
was merged earlier which modified some file your change has also modified.
You can either fetch your change to your local clone and rebase it on the latest upstream branch
or enable content merge for your project [1] and try to submit once more. Then you only have to
rebase locally in case you still get a merge conflict. 

Mohan Kumar

unread,
May 8, 2018, 8:56:05 AM5/8/18
to Repo and Gerrit Discussion
Yes as per error message I have tried the below. On Command line executed

1.git pull
2.got rebase -i
It finished successfully.on Gerrit GUI user had totally five open gerrit review requests. Out (5). For (2) requests it says merged. Now I have (3) more requests for that also it says same error message. So I need to perform again the above steps? Plz advise.

Matthias Sohn

unread,
May 8, 2018, 9:01:25 AM5/8/18
to Mohan Kumar, Repo and Gerrit Discussion
if your changes are pushed for the master branch the second step should be

$ git rebase origin/master
 resolve conflicts if any
$ git push origin HEAD:refs/for/master

 
--
--
To unsubscribe, email repo-discuss+unsubscribe@googlegroups.com
More info at http://groups.google.com/group/repo-discuss?hl=en

---
You received this message because you are subscribed to the Google Groups "Repo and Gerrit Discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to repo-discuss+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Mohan Kumar

unread,
May 8, 2018, 10:50:53 AM5/8/18
to Repo and Gerrit Discussion
No all the changes were pushed to gerrit earlier for private branch not to master. So in the above command instead of master i can change to our private branch and then i can push correct.

Mohan Kumar

unread,
May 9, 2018, 5:10:24 AM5/9/18
to Repo and Gerrit Discussion

Thanks a lot Matthias. I have resolved my running git rebase and git push.

Reply all
Reply to author
Forward
0 new messages