How can I fetch an unmerged pull request for a branch I don't own?

user156888 picture user156888 · Jul 19, 2011 · Viewed 54k times · Source

I need to pull in a specific pull request (that hasn't been processed into the main stream yet) in the NServiceBus repo:

https://github.com/johnsimons/NServiceBus/commit/d8524d53094e8181716e771c1023e968132abc15

It's obviously not my repo, but I need the changes that exist in that pull request.

What is the best way to do this?

Answer

wolfc picture wolfc · Mar 28, 2012

To fetch a pull into your repository:

git fetch [email protected]:jboss/jboss-common-beans.git refs/pull/4/head

Then do whatever you want with FETCH_HEAD:

git checkout -b new-branch FETCH_HEAD