Reputation: 13210
(Sorry I'm sure this has been asked before but I cant find answer maybe using wrong terminology)
So I have a github project forked from another, my master branch is currently 5 commits ahead, 21 commits behind the master branch of the original project.
So I want any corresponding code changes in those 21 commits to be applied to my fork. Of course I don't want to lose the changes corresponding to my 5 commits either, and these changes wont be finding there way into the original project since they only make sense for my environment.
But all I seem able to do on github is create a Pull request to submit my changes to the original master, how do I do what I want.
Upvotes: 0
Views: 75
Reputation: 66741
Basically you need to re-merge with them, so checkout your fork, then add them as a remote, and re-sync:
$ git remote add <repo_url_of_non_fork> other_guy
$ git fetch other_guy
$ git merge other_guy/master
$ git push origin <current-branch>
GL!
Update: a GUI way has been discovered. Go to your fork. There is a little message saying how far back you are. Click "Pull request" to its right.
Then click "try switching the base" so it'll pull the direction you want. Click "create pull request" then "merge" or something like that. It seems to (buggishly?) list tons of commits but it'll merge as you'd like.
Then you'll have to do a git pull locally.
Upvotes: 1