Skip to content

Instantly share code, notes, and snippets.

@ecarreras
Forked from kennethreitz/pr.md
Last active December 14, 2015 21:28
Show Gist options
  • Save ecarreras/5150871 to your computer and use it in GitHub Desktop.
Save ecarreras/5150871 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:

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

Now add a new remote. Obviously, change the github url to match your project's URL. It ends up looking like this:

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

Now fetch all the pull requests:

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

To merge a particular pull request into developer:

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