Take the 2-minute tour ×

How can I apply pull request that was made for a parent repository of my fork into codebar of my fork. Not sure anyone can understand this question :), I'll try to explain with an an example.

There is a repo https://github.com/balupton/history.js, there are some pull request for this repo that has not been merged into the codebase, for example this one https://github.com/balupton/history.js/pull/251/commits. For some reason original developer do not accept it. Now, I have forked this repo https://github.com/prudnikov/history.js and want to merge this particular pull request into mu repository. How can I do this?

share|improve this question
Github is actually designed to make this harder... because their revenue model is based on company accounts. If you upgrade to an organisation, you may find this easier. –  Alias Cummins Oct 24 '13 at 12:30
add comment

1 Answer

up vote 4 down vote accepted

You should be able to just pull down the other repo and have it merge with yours.

git pull {url-of-repo-with-commit-you-want-to-merge-in}

This will fetch the repo mentioned and have it automatically fast forward merge in any commits you don't have into yours.

So in your example, while on your master branch, or if you want to test it out on some other branch:

git pull git://github.com/dantipa/history.js.git
remote: Counting objects: 9, done.
remote: Total 5 (delta 4), reused 5 (delta 4)
From git://github.com/dantipa/history.js
 * branch            HEAD       -> FETCH_HEAD
Updating e84ad00..e2d5251
 scripts/uncompressed/history.js |    2 +-

Now with the other commit merged with yours you can push back up to your own remote with that extra change.

share|improve this answer
But this will pull in whole branch with all commits that ahead current HEAD, right? –  Vladimir Prudnikov Feb 7 '13 at 14:02
Oh, i've got an idea. I should create a new branch locally, pull down commits from other repo, then back to the master and cherry-pick desired commits. –  Vladimir Prudnikov Feb 7 '13 at 14:05
Yes, working in a different branch you can cherry-pick from would be safer and allow more control –  Eight Days of Malaise Feb 7 '13 at 17:15
Be mindful if you actually cherry-pick commits from another forked repo as this might create confusion if you create your own pull request for the repo originally forked from. –  Chris Mar 7 '13 at 4:03
add comment

Your Answer


