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

5,633 views
Skip to first unread message

Dnyaneshwar

unread,
Mar 13, 2014, 6:52:13 AM3/13/14
to repo-d...@googlegroups.com
i have recently setup the gerrit server for my projects
and continuously facing the conflict issues
can you tell why i am getting this errors,

"The change could not be merged due to a path conflict.

Please rebase the change locally and upload the rebased commit for review."

whats is the permanent and proper solution for this issues

Thanks

Saša Živkov

unread,
Mar 13, 2014, 7:52:07 AM3/13/14
to Dnyaneshwar, repo-d...@googlegroups.com
Exactly what was written in the error message, rebase and upload a new patch-set.
Basically:
$ git checkout <the-branch-where-you-did-the-change>
$ git rebase origin/master
... resolve all conflicts..
... don't forget to "git add <file>" after resolving conflicts in that <file>
$ git rebase --continue



Thanks

--
--
To unsubscribe, email repo-discuss...@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...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Dnyaneshwar

unread,
Mar 13, 2014, 8:55:42 AM3/13/14
to repo-d...@googlegroups.com
Hi Zivkov,
Thanks for the help

what you mean 
git checkout <the-branch-where-you-did-the-
change>

i have one only one branch master in my local machine

and have pushed the changes to remote master

so i have checkout local or remote branch ?

our developers are constantly facing the same issue can you tell me causing of this issue

Thanks Again.!

i were made changes in my local r

Saša Živkov

unread,
Mar 13, 2014, 9:10:50 AM3/13/14
to Dnyaneshwar, repo-d...@googlegroups.com
On Thu, Mar 13, 2014 at 1:55 PM, Dnyaneshwar <dnyaneshwar...@gmail.com> wrote:
Hi Zivkov,
Thanks for the help

what you mean 
git checkout <the-branch-where-you-did-the-
change>
I mean to checkout the commit which you pushed to gerrit. 

i have one only one branch master in my local machine
sorry, I didn't know that.

Instead of checking out a branch you can checkout the commit:
$ git checkout <commit-id>


and have pushed the changes to remote master

so i have checkout local or remote branch ?

our developers are constantly facing the same issue can you tell me causing of this issue

Thanks Again.!

i were made changes in my local r


On Thursday, 13 March 2014 16:22:13 UTC+5:30, Dnyaneshwar wrote:
i have recently setup the gerrit server for my projects
and continuously facing the conflict issues
can you tell why i am getting this errors,

"The change could not be merged due to a path conflict.

Please rebase the change locally and upload the rebased commit for review."

whats is the permanent and proper solution for this issues

Thanks

David Pursehouse

unread,
Mar 13, 2014, 9:39:19 PM3/13/14
to Dnyaneshwar, repo-d...@googlegroups.com
On 03/13/2014 09:55 PM, Dnyaneshwar wrote:
> Hi Zivkov,
> Thanks for the help
>
> what you mean
> git checkout <the-branch-where-you-did-the-
> change>
>
> i have one only one branch master in my local machine
>
> and have pushed the changes to remote master
>
> so i have checkout local or remote branch ?
>
> our developers are constantly facing the same issue can you tell me
> causing of this issue
>

The error occurs when you try to submit a change whose parent is not the
latest head of the branch, and the change modifies files that are also
modified in other commits that were merged between your change's parent
and the current head.

To solve this you have to rebase the change, either using the method
mentioned by Sasa, or using the "rebase" button on the UI.

Alternatively, you can try to enable the "Automatically resolve
conflicts" option for the project. This may reduce the occurrence of
the "due to path conflict" error, but is not guaranteed to be able to
solve all merge conflicts.

Dnyaneshwar

unread,
Mar 14, 2014, 1:27:01 AM3/14/14
to repo-d...@googlegroups.com, Dnyaneshwar
Hi David,
Thanks for the reply,
As a developer what should be way to commit and push to avoid conflicts,

do we need to get pull before commit ?

I have already enabled "Automatically resolve conflicts"

Rebase Change option in gerrit says "The change could not be rebased due to a path conflict during merge."

David Pursehouse

unread,
Mar 14, 2014, 3:40:42 AM3/14/14
to Dnyaneshwar, repo-d...@googlegroups.com
On 03/14/2014 02:27 PM, Dnyaneshwar wrote:
> Hi David,
> Thanks for the reply,
> As a developer what should be way to commit and push to avoid conflicts,
>
The best way is to not work on the same files :)

> do we need to get pull before commit ?
>
That will help for new changes, but then it can still happen that
someone else's change gets merged while yours is under review. In that
case you'll have to pull/fetch again, fix conflicts, and upload a new
patch set.

Dnyaneshwar

unread,
Mar 14, 2014, 4:18:07 AM3/14/14
to repo-d...@googlegroups.com, Dnyaneshwar
Hi David thanks for the quick response ,


That will help for new changes, but then it can still happen that
someone else's change gets merged while yours is under review.  In that
case you'll have to pull/fetch again, fix conflicts, and upload a new
patch set.

can you tell command or steps for this, to fetch and submit pach set to gerrit i m new to git/gerrit

Matthias Sohn

unread,
Mar 14, 2014, 4:41:54 AM3/14/14
to Dnyaneshwar, Repo and Gerrit Discussion
On Fri, Mar 14, 2014 at 9:18 AM, Dnyaneshwar <dnyaneshwar...@gmail.com> wrote:
Hi David thanks for the quick response ,


That will help for new changes, but then it can still happen that
someone else's change gets merged while yours is under review.  In that
case you'll have to pull/fetch again, fix conflicts, and upload a new
patch set.

can you tell command or steps for this, to fetch and submit pach set to gerrit i m new to git/gerrit

Luca Milanesio

unread,
Mar 14, 2014, 6:01:07 AM3/14/14
to Matthias Sohn, Dnyaneshwar, Repo and Gerrit Discussion
I managed to get a promotional offer for the "Learning Gerrit Code Review" book during the Gerrit User Summit 2014.

If you want to save some money on the book, there is a special offer for buying the book valid until the 27th of March 2014:

Link to buy the book with the promotional discount:

Promo-Codes:
Book: LGCRB20 
eBook: LGCReB20 

Luca.
Reply all
Reply to author
Forward
0 new messages