Skip to content

Instantly share code, notes, and snippets.

@beddari
Forked from ecarreras/pr.md
Created August 1, 2014 16:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save beddari/4fc68eb163f5ee6274ba to your computer and use it in GitHub Desktop.
Save beddari/4fc68eb163f5ee6274ba to your computer and use it in GitHub Desktop.

Locate the section for your github remote in the .git/config file. It looks like this:

Now add this lines:

[remote "github"]
	url = git@github.com:joyent/node.git
	fetch = +refs/pull/*/head:refs/remotes/github/pr/*

Now fetch all the pull requests:

$ git fetch github
From github.com:joyent/node
 * [new ref]         refs/pull/1000/head -> origin/pr/1000
 * [new ref]         refs/pull/1002/head -> origin/pr/1002
 * [new ref]         refs/pull/1004/head -> origin/pr/1004
 * [new ref]         refs/pull/1009/head -> origin/pr/1009
...

To check out a particular pull request:

$ git checkout pr/999
Branch pr/999 set up to track remote branch pr/999 from origin.
Switched to a new branch 'pr/999'

To merge one pull-request

$ git merge github/pr/387
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment