Pritam Banerjee Pritam Banerjee - 5 months ago 39
Git Question

How to solve merge conflicts across forks?

I have forked my repo say repoB from another repo say repoA. Now I don't have permissions to write into repoA.

When I try to create a pull request on repoA to get the latest changes and merge those in to repoB I get a merge conflict error. How do I solve that?

I tried this:

git checkout -b repoA master
git pull https:repoA master

git checkout master
git merge --no-ff repoA
git push origin master

N.B. I cannot checkout forkA as I don't have write permissions on that.


First add the upstream remote

git remote add upstream https://repoA
git fetch upstream

Merge in upstream changes:

git add .
git commit -m "message"
git checkout master
git merge upstream/master

Resolve conflicts and push

git push origin master

Your pull request should automatically update