Pritam Banerjee
Pritam Banerjee

Reputation: 18923

How to solve merge conflicts across forks?

I have forked my repo, we'll call it repoB from another repo we'll call 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.

Upvotes: 30

Views: 26519

Answers (1)

Jeff Puckett
Jeff Puckett

Reputation: 40861

First add the upstream remote

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

Merge in upstream changes

git checkout master
git merge upstream/master

Resolve conflicts and push

git push origin master

Your pull request should automatically update

Upvotes: 67

Related Questions