4

One of my outgoing review was showing merge conflict (not submitted, in process). I fetched the latest from master and then merged that with my feature branch and updated my change list on gerrit. But it is still showing merge conflict.

I have looked into the files and I have grepped the whole directory for <<<<<<< HEAD . But I could not find any conflict.

enter image description here

imox
  • 1,544
  • 12
  • 12

2 Answers2

1

I have looked into the files

Those would be your files locally, which haven't been merged.

As in "How to solve merge conflict in a approved review in gerrit?", fetch the changeset, rebase it locally onto origin/<yourBranch>: you should see conflicts there.

The idea is to resolve conflicts locally, then push back the modified changeset.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • 1
    Yes, I fetched the changeset, merged my local branch with master, resolved conflict and then pushed it. But still it is showing the same merge conflict as status. – imox Jun 21 '19 at 05:35
  • @imox I don't think a merge is recommended here: only a rebase. And a rebase to an up-to-date master. – VonC Jun 21 '19 at 05:38
  • thanks for your comment. do you mean not recommended and will not work? can you please tell me why? What options do I have now to remove the merge conflict? – imox Jun 21 '19 at 05:40
  • @imox Try and follow https://stackoverflow.com/questions/53209237/how-to-solve-merge-conflict-in-a-approved-review-in-gerrit/53213237#53213237, which shows a rebase. – VonC Jun 21 '19 at 05:41
  • Looking into it. but my review is in process and not approved. – imox Jun 21 '19 at 05:43
1

I had same problem some days ago. In my case, after merging I have made git reset --soft HEAD~ which transfered my changes from "commited" to "staged". Then I have commited them again and it worked. It was strange behavior but it is never happened again.

HereAndBeyond
  • 794
  • 1
  • 8
  • 17