It is strange that there is merge conflict for the following steps:
- I forked a repo
foo
on GitHub - I
git clone
this forked repo to my hard drive - After 3 days, somebody committed a lot of code to a branch
xyz
- So to make the branch exactly the same on my forked repo, I
git clone
again from the forked repo to a new folderbar
cd bar
git checkout xyz
git remote add upstream <the URL for foo>
git pull upstream xyz
And tons of merge conflict appeared. I never touched anything in the branch xyz
. It was another developer who committed a lot of things into xyz
, so the branch xyz
should be just updated with all his changed, instead of having merge conflicts. Later on he said that it had merge conflicts because he git push -f
and that if he never used -f
, then it shouldn't have merge conflicts.
How is this situation solved?