I\'m using the NSDate-Extensions plugin in my iOS Xcode project. The master repo has some errors which seems to be fixed in two Pull Requests:
Add a .patch
to the end of the pull url - you can download and apply the patch on your repo:
curl https://github.com/erica/NSDate-Extensions/pull/6.patch | git am
You can pull the requests from the command line without adding remotes:
git pull https://github.com/erica/NSDate-Extensions +refs/pull/6/head
If you are not already sure you want to do that, then you might want to check out that branch first with:
git fetch https://github.com/erica/NSDate-Extensions +refs/pull/6/head:refs/origin/pull/6
The advantage of this compared to using the patch files is that git gets the actual commits. So git can see when master was previously merged into the pull request. The patch file is completely unaware of such differences.
You should add the forks that offered the pull requests, and add them as a remote:
Find the person contributing the link (normally just click the sha1 hash)
Do something like:
git remote add githubuser theirgithubfork.git
Then you can easily pull down their changes:
git fetch githubuser
Easily take individual commits with"
git cherry-pick thesha1fromthepullrequest
For a complete example, imagine this pull request (6bbbcc5) from RogerE on the Ruby Capistrano project.
$ git clone git@github.com:capistrano/capistrano.git
$ cd capistrano
$ git remote add RogerE https://github.com/RogerE/capistrano.git
$ git fetch RogerE
$ git cherry-pick 6bbbcc5
You can pull specific pull requests like this:
git pull https://github.com/erica/NSDate-Extensions/pull/6
git pull https://github.com/erica/NSDate-Extensions/pull/7
imo this is much easier than adding a remote (especially when it is just one-off fixes) or piping via curl.