From a GitHub pull request
1. Clone the canonical ASF repo
git clone https://gitbox.apache.org/repos/asf/jclouds.git
2. Configure a github remote to also fetch the pull requests, and checkout them as follows (for a complete guide refer to the GitHub howto):
git remote add github firstname.lastname@example.org:apache/jclouds.git
git config --local --add remote.github.fetch '+refs/pull/*/head:refs/remotes/github/pr/*'
# Now when fetching you will see all the pull requests (you can checkout them with "git checkout github/pr/99"):
git fetch github
* [new ref] refs/pull/98/head -> github/pr/98
* [new ref] refs/pull/99/head -> github/pr/99
3. Cherry pick the commit you want to merge
git cherry-pick hash-to-merge
4. Push the commit (you'll want to setup a .netrc file to make this easy, see Committers: Getting Started)
git push origin master # Or the appropriate branch
Just merge it normally from the GitHUb site.
From a patch file
1. Save the patch from the Github patch link (just append '.patch' to the pull request link to get it). This patch will keep the authorship of the commit, so we should use it instead of the diff.