0

I did a pull request from my EVRO branch to my STABLE branch.

This branch has conflicts that must be resolved
Use the command line to resolve conflicts before continuing.
Conflicting files
.idea/.idea.TibiaScape/.idea/workspace.xml
OpenGLTemplate/Release/Creature.obj
OpenGLTemplate/Release/TibiaScape.iobj
OpenGLTemplate/Release/TibiaScape.ipdb
OpenGLTemplate/Release/TibiaScape.tlog/CL.command.1.tlog
OpenGLTemplate/Release/TibiaScape.tlog/CL.read.1.tlog
OpenGLTemplate/Release/TibiaScape.tlog/CL.write.1.tlog
OpenGLTemplate/Release/TibiaScape.tlog/link.read.1.tlog
OpenGLTemplate/Release/TibiaScape.tlog/link.write.1.tlog
OpenGLTemplate/Release/Waypoint.obj
OpenGLTemplate/Release/dllmain.obj
OpenGLTemplate/Release/hooks.obj
OpenGLTemplate/Release/vc143.pdb
OpenGLTemplate/Source/dllmain.cpp
Release/TibiaScape.dll
Release/TibiaScape.pdb

I can see an information box in the "Resolve conflicts" button that says: These conflicts are too complex to resolve in the web editor

So I'm trying to follow the github documentation, it says that with command git status I will get all conflicts, then I can just navigate to the file and fix manually. But my reality is different:

PS C:\Users\Adrian\Documents\GitHub\TibiaScape> git checkout stable
Switched to branch 'stable'
Your branch is up to date with 'origin/stable'.

PS C:\Users\Adrian\Documents\GitHub\TibiaScape> git status
On branch stable
Your branch is up to date with 'origin/stable'.

PS C:\Users\Adrian\Documents\GitHub\TibiaScape> git checkout evro
Switched to branch 'evro'
Your branch is based on 'origin/evro', but the upstream is gone.
  (use "git branch --unset-upstream" to fixup)
PS C:\Users\Adrian\Documents\GitHub\TibiaScape> git branch --unset-upstream

PS C:\Users\Adrian\Documents\GitHub\TibiaScape> git status
On branch evro
nothing to commit, working tree clean

How can I review the conflicts so I can fix them and continue with the merge?

kuhi
  • 531
  • 5
  • 23

2 Answers2

3

To keep a clean history without merging back and forth, i'd do a rebase. That in fact gives you the same tasks to resolve the conflicts, but keeps a clear history of the main-branch with side-branches.

The interactive rebase (-i) shows you, what it does. It takes the current stable branch and picks the single commits of your devro branch. Take care, so it only shows the necessary commits to pick. It will show you each time a conflict is created on rebase, this you will have to solve in your code-editor. Afterwards, stage (add) your changes and continue the rebase. Git will also tell you that. git status is for me often quite helpful from time to time in that process.

Finally you will need to force-push your branch as there are completely new commits now. Be careful with that, maybe double-check if your changes are alright.

So from:

--A---B---C---XXX
   \         /
     ---D---

Don't do:

--A---B---C--------M2
   \       \      /
     ---D---M1---

But better:

--A---B---C-----------M
           \         /
             ---D---
git checkout stable; git pull;
git checkout devro;
git rebase -i stable;

[git status; git add .; git rebase --continue]

git push; -> force!
Jonas
  • 164
  • 7
1

did a pull request from my EVRO branch to my STABLE branch

This means you are trying to merge evro into stable. But you can't because there are merge conflicts. The solution is, on your local machine, to do a reverse merge: merge stable into evro. You'll get the same conflicts. Resolve them, finish the merge, and push! Now you'll be able to merge the pull request on GitHub.

git fetch origin
git switch origin/evro --det
git switch -c evro
git merge origin/stable
# resolve conflicts
git add .
git merge --continue
# provide merge commit message
git push origin @
# on GitHub press the Merge button on your PR
matt
  • 515,959
  • 87
  • 875
  • 1,141
  • But the loss of linkage between your old local evro and its remote tracking branch is a worry. Did you rename this branch on GitHub? That could complicate matters. Read https://stackoverflow.com/questions/21609781/why-call-git-branch-unset-upstream-to-fixup – matt Jul 07 '22 at 10:26