2

I'm trying to rebase my local feature branch on remote branch called 'integration'.

So I did-

git checkout feature
git rebase integration

but in my conflict resolution editor, I see changes from feature at the bottom and 'integration' on top, which I believe is upside down. How do I fix it?

It looks like-

<<<<<<< HEAD
<code from integration>
=======
<code from feature>
>>>>>>>
codebee
  • 824
  • 1
  • 9
  • 22

1 Answers1

2

When you do a rebase, branches are switched, and that's why they appeared to be inverted in your conflict resolution editor.

According to the documentation:

Note that a rebase merge works by replaying each commit from the working branch on top of the <upstream> branch.

So the your local branch feature commits are applied to the upstream branch integration.

This causes a lot of confusion and there's nothing to do about it, just remember branches will be inverted when rebasing.

When resolving conflicts, your local branch is referred as ours while the other branch is referred as theirs. During a rebase conflict resolution, ours appears are theirs and theirs appears as ours. So if you want to know more about this issue you can search for other answers on SO using keywords "ours", "theirs" and "rebase". One great answer is this one that I used to answer yours and it goes further in the explanation, if I wasn't clear enough.

Community
  • 1
  • 1
Roberto
  • 11,557
  • 16
  • 54
  • 68