Skip to content

Instantly share code, notes, and snippets.

@alarian
Forked from piscisaureus/pr.md
Last active November 6, 2019 03:38
Show Gist options
  • Save alarian/c647bdb51ccac83efe8eee695e20f636 to your computer and use it in GitHub Desktop.
Save alarian/c647bdb51ccac83efe8eee695e20f636 to your computer and use it in GitHub Desktop.
Checkout github pull requests locally
[
{
"author_association": "NONE",
"body": "LOVELY.\n",
"created_at": "2012-08-13T16:49:05Z",
"id": 397376,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0NzozOTczNzY=",
"updated_at": "2012-08-13T16:49:05Z",
"url": "https://api.github.com/gists/3342247/comments/397376",
"user": {
"login": "DTrejo",
"id": 56119,
"node_id": "MDQ6VXNlcjU2MTE5",
"avatar_url": "https://avatars2.githubusercontent.com/u/56119?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/DTrejo",
"html_url": "https://github.com/DTrejo",
"followers_url": "https://api.github.com/users/DTrejo/followers",
"following_url": "https://api.github.com/users/DTrejo/following{/other_user}",
"gists_url": "https://api.github.com/users/DTrejo/gists{/gist_id}",
"starred_url": "https://api.github.com/users/DTrejo/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/DTrejo/subscriptions",
"organizations_url": "https://api.github.com/users/DTrejo/orgs",
"repos_url": "https://api.github.com/users/DTrejo/repos",
"events_url": "https://api.github.com/users/DTrejo/events{/privacy}",
"received_events_url": "https://api.github.com/users/DTrejo/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "Hey cool. Didn't know you could do that! :) Thanks.\n",
"created_at": "2012-08-13T20:31:39Z",
"id": 397461,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0NzozOTc0NjE=",
"updated_at": "2012-08-13T20:31:39Z",
"url": "https://api.github.com/gists/3342247/comments/397461",
"user": {
"login": "chilts",
"id": 3048,
"node_id": "MDQ6VXNlcjMwNDg=",
"avatar_url": "https://avatars1.githubusercontent.com/u/3048?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/chilts",
"html_url": "https://github.com/chilts",
"followers_url": "https://api.github.com/users/chilts/followers",
"following_url": "https://api.github.com/users/chilts/following{/other_user}",
"gists_url": "https://api.github.com/users/chilts/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chilts/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chilts/subscriptions",
"organizations_url": "https://api.github.com/users/chilts/orgs",
"repos_url": "https://api.github.com/users/chilts/repos",
"events_url": "https://api.github.com/users/chilts/events{/privacy}",
"received_events_url": "https://api.github.com/users/chilts/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "GENIUS!\n",
"created_at": "2012-08-13T23:43:07Z",
"id": 397521,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0NzozOTc1MjE=",
"updated_at": "2012-08-13T23:43:07Z",
"url": "https://api.github.com/gists/3342247/comments/397521",
"user": {
"login": "sminnee",
"id": 59968,
"node_id": "MDQ6VXNlcjU5OTY4",
"avatar_url": "https://avatars1.githubusercontent.com/u/59968?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/sminnee",
"html_url": "https://github.com/sminnee",
"followers_url": "https://api.github.com/users/sminnee/followers",
"following_url": "https://api.github.com/users/sminnee/following{/other_user}",
"gists_url": "https://api.github.com/users/sminnee/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sminnee/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sminnee/subscriptions",
"organizations_url": "https://api.github.com/users/sminnee/orgs",
"repos_url": "https://api.github.com/users/sminnee/repos",
"events_url": "https://api.github.com/users/sminnee/events{/privacy}",
"received_events_url": "https://api.github.com/users/sminnee/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "So much love \\o/\n",
"created_at": "2012-08-14T08:46:32Z",
"id": 397644,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0NzozOTc2NDQ=",
"updated_at": "2012-08-14T08:46:32Z",
"url": "https://api.github.com/gists/3342247/comments/397644",
"user": {
"login": "naholyr",
"id": 214067,
"node_id": "MDQ6VXNlcjIxNDA2Nw==",
"avatar_url": "https://avatars2.githubusercontent.com/u/214067?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/naholyr",
"html_url": "https://github.com/naholyr",
"followers_url": "https://api.github.com/users/naholyr/followers",
"following_url": "https://api.github.com/users/naholyr/following{/other_user}",
"gists_url": "https://api.github.com/users/naholyr/gists{/gist_id}",
"starred_url": "https://api.github.com/users/naholyr/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/naholyr/subscriptions",
"organizations_url": "https://api.github.com/users/naholyr/orgs",
"repos_url": "https://api.github.com/users/naholyr/repos",
"events_url": "https://api.github.com/users/naholyr/events{/privacy}",
"received_events_url": "https://api.github.com/users/naholyr/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": ":star:\n",
"created_at": "2012-08-14T16:32:09Z",
"id": 397838,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0NzozOTc4Mzg=",
"updated_at": "2012-08-14T16:32:09Z",
"url": "https://api.github.com/gists/3342247/comments/397838",
"user": {
"login": "AlekSi",
"id": 11512,
"node_id": "MDQ6VXNlcjExNTEy",
"avatar_url": "https://avatars1.githubusercontent.com/u/11512?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/AlekSi",
"html_url": "https://github.com/AlekSi",
"followers_url": "https://api.github.com/users/AlekSi/followers",
"following_url": "https://api.github.com/users/AlekSi/following{/other_user}",
"gists_url": "https://api.github.com/users/AlekSi/gists{/gist_id}",
"starred_url": "https://api.github.com/users/AlekSi/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/AlekSi/subscriptions",
"organizations_url": "https://api.github.com/users/AlekSi/orgs",
"repos_url": "https://api.github.com/users/AlekSi/repos",
"events_url": "https://api.github.com/users/AlekSi/events{/privacy}",
"received_events_url": "https://api.github.com/users/AlekSi/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "thanks!\n",
"created_at": "2012-08-14T20:51:05Z",
"id": 397989,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0NzozOTc5ODk=",
"updated_at": "2012-08-14T20:51:05Z",
"url": "https://api.github.com/gists/3342247/comments/397989",
"user": {
"login": "cordoval",
"id": 328359,
"node_id": "MDQ6VXNlcjMyODM1OQ==",
"avatar_url": "https://avatars0.githubusercontent.com/u/328359?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/cordoval",
"html_url": "https://github.com/cordoval",
"followers_url": "https://api.github.com/users/cordoval/followers",
"following_url": "https://api.github.com/users/cordoval/following{/other_user}",
"gists_url": "https://api.github.com/users/cordoval/gists{/gist_id}",
"starred_url": "https://api.github.com/users/cordoval/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cordoval/subscriptions",
"organizations_url": "https://api.github.com/users/cordoval/orgs",
"repos_url": "https://api.github.com/users/cordoval/repos",
"events_url": "https://api.github.com/users/cordoval/events{/privacy}",
"received_events_url": "https://api.github.com/users/cordoval/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": ":sailboat:\n",
"created_at": "2012-08-15T21:09:42Z",
"id": 398966,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0NzozOTg5NjY=",
"updated_at": "2012-08-15T21:09:42Z",
"url": "https://api.github.com/gists/3342247/comments/398966",
"user": {
"login": "johnnagro",
"id": 31442,
"node_id": "MDQ6VXNlcjMxNDQy",
"avatar_url": "https://avatars0.githubusercontent.com/u/31442?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/johnnagro",
"html_url": "https://github.com/johnnagro",
"followers_url": "https://api.github.com/users/johnnagro/followers",
"following_url": "https://api.github.com/users/johnnagro/following{/other_user}",
"gists_url": "https://api.github.com/users/johnnagro/gists{/gist_id}",
"starred_url": "https://api.github.com/users/johnnagro/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/johnnagro/subscriptions",
"organizations_url": "https://api.github.com/users/johnnagro/orgs",
"repos_url": "https://api.github.com/users/johnnagro/repos",
"events_url": "https://api.github.com/users/johnnagro/events{/privacy}",
"received_events_url": "https://api.github.com/users/johnnagro/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "awesome!\n",
"created_at": "2012-08-16T04:25:34Z",
"id": 399114,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0NzozOTkxMTQ=",
"updated_at": "2012-08-16T04:25:34Z",
"url": "https://api.github.com/gists/3342247/comments/399114",
"user": {
"login": "mikaelkaron",
"id": 478468,
"node_id": "MDQ6VXNlcjQ3ODQ2OA==",
"avatar_url": "https://avatars2.githubusercontent.com/u/478468?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/mikaelkaron",
"html_url": "https://github.com/mikaelkaron",
"followers_url": "https://api.github.com/users/mikaelkaron/followers",
"following_url": "https://api.github.com/users/mikaelkaron/following{/other_user}",
"gists_url": "https://api.github.com/users/mikaelkaron/gists{/gist_id}",
"starred_url": "https://api.github.com/users/mikaelkaron/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mikaelkaron/subscriptions",
"organizations_url": "https://api.github.com/users/mikaelkaron/orgs",
"repos_url": "https://api.github.com/users/mikaelkaron/repos",
"events_url": "https://api.github.com/users/mikaelkaron/events{/privacy}",
"received_events_url": "https://api.github.com/users/mikaelkaron/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "Nice! I dropped this in my rc file to make this process easy:\nfunction pullify() { \n git config --add remote.origin.fetch '+refs/pull/_/head:refs/remotes/origin/pr/_' \n} \n",
"created_at": "2012-08-25T22:17:17Z",
"id": 420575,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo0MjA1NzU=",
"updated_at": "2012-08-25T22:17:17Z",
"url": "https://api.github.com/gists/3342247/comments/420575",
"user": {
"login": "cldwalker",
"id": 11994,
"node_id": "MDQ6VXNlcjExOTk0",
"avatar_url": "https://avatars0.githubusercontent.com/u/11994?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/cldwalker",
"html_url": "https://github.com/cldwalker",
"followers_url": "https://api.github.com/users/cldwalker/followers",
"following_url": "https://api.github.com/users/cldwalker/following{/other_user}",
"gists_url": "https://api.github.com/users/cldwalker/gists{/gist_id}",
"starred_url": "https://api.github.com/users/cldwalker/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/cldwalker/subscriptions",
"organizations_url": "https://api.github.com/users/cldwalker/orgs",
"repos_url": "https://api.github.com/users/cldwalker/repos",
"events_url": "https://api.github.com/users/cldwalker/events{/privacy}",
"received_events_url": "https://api.github.com/users/cldwalker/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "OWNER",
"body": "@cldwalker\n\nThanks. I just realized that with this trick you can enable it for _all_ your repos at once :-)\n\n`git config --global --add remote.origin.fetch \"+refs/pull/*/head:refs/remotes/origin/pr/*\"`\n",
"created_at": "2012-08-27T13:55:11Z",
"id": 430273,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo0MzAyNzM=",
"updated_at": "2012-08-27T13:55:11Z",
"url": "https://api.github.com/gists/3342247/comments/430273",
"user": {
"login": "piscisaureus",
"id": 218257,
"node_id": "MDQ6VXNlcjIxODI1Nw==",
"avatar_url": "https://avatars2.githubusercontent.com/u/218257?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/piscisaureus",
"html_url": "https://github.com/piscisaureus",
"followers_url": "https://api.github.com/users/piscisaureus/followers",
"following_url": "https://api.github.com/users/piscisaureus/following{/other_user}",
"gists_url": "https://api.github.com/users/piscisaureus/gists{/gist_id}",
"starred_url": "https://api.github.com/users/piscisaureus/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/piscisaureus/subscriptions",
"organizations_url": "https://api.github.com/users/piscisaureus/orgs",
"repos_url": "https://api.github.com/users/piscisaureus/repos",
"events_url": "https://api.github.com/users/piscisaureus/events{/privacy}",
"received_events_url": "https://api.github.com/users/piscisaureus/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "Just for fetching only one pull request. Handy, if you're hacking on something.\n\n<pre>\n git fetch origin pull/7324/head:pr-7324\n</pre>\n\n\n`origin` points to the remote server.\n`pull/7324/head` is the remote pull request.\n`pr-7324` is the local pull-request branch.\n",
"created_at": "2012-09-27T16:03:22Z",
"id": 580127,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo1ODAxMjc=",
"updated_at": "2012-09-27T16:03:22Z",
"url": "https://api.github.com/gists/3342247/comments/580127",
"user": {
"login": "andhapp",
"id": 6663,
"node_id": "MDQ6VXNlcjY2NjM=",
"avatar_url": "https://avatars1.githubusercontent.com/u/6663?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/andhapp",
"html_url": "https://github.com/andhapp",
"followers_url": "https://api.github.com/users/andhapp/followers",
"following_url": "https://api.github.com/users/andhapp/following{/other_user}",
"gists_url": "https://api.github.com/users/andhapp/gists{/gist_id}",
"starred_url": "https://api.github.com/users/andhapp/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/andhapp/subscriptions",
"organizations_url": "https://api.github.com/users/andhapp/orgs",
"repos_url": "https://api.github.com/users/andhapp/repos",
"events_url": "https://api.github.com/users/andhapp/events{/privacy}",
"received_events_url": "https://api.github.com/users/andhapp/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "@piscisaureus The global config trick has an unfortunate side-effect. See http://stackoverflow.com/questions/13572191/cannot-remove-remote-origin/. Might be worth the tradeoff, but it's worth being aware of.\n",
"created_at": "2012-11-26T20:38:56Z",
"id": 608408,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo2MDg0MDg=",
"updated_at": "2012-11-26T20:38:56Z",
"url": "https://api.github.com/gists/3342247/comments/608408",
"user": {
"login": "TrevorBurnham",
"id": 224895,
"node_id": "MDQ6VXNlcjIyNDg5NQ==",
"avatar_url": "https://avatars1.githubusercontent.com/u/224895?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/TrevorBurnham",
"html_url": "https://github.com/TrevorBurnham",
"followers_url": "https://api.github.com/users/TrevorBurnham/followers",
"following_url": "https://api.github.com/users/TrevorBurnham/following{/other_user}",
"gists_url": "https://api.github.com/users/TrevorBurnham/gists{/gist_id}",
"starred_url": "https://api.github.com/users/TrevorBurnham/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/TrevorBurnham/subscriptions",
"organizations_url": "https://api.github.com/users/TrevorBurnham/orgs",
"repos_url": "https://api.github.com/users/TrevorBurnham/repos",
"events_url": "https://api.github.com/users/TrevorBurnham/events{/privacy}",
"received_events_url": "https://api.github.com/users/TrevorBurnham/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "Your refspec is wrong, isn't it?\n\n```\n[remote \"origin\"]\n fetch = +refs/heads/*:refs/remotes/origin/*\n url = [email protected]:joyent/node.git\n fetch = +refs/pull/*/head:refs/remotes/origin/pr/*\n```\n\nIn case you retrieve a branch named `pr/3` from the origin fetched based on your first refspec `+refs/heads/*:refs/remotes/origin/*` and there is a third pull request, it would conflict. I never tried it, but that's why I got `fetch = +refs/pull/*/head:refs/gh-pull/remotes/origin/*` as refspec, which is not conflicting with anything of git.\n\nOn a side note, when building scripts imitating the \"merge\"-button of github, you can make use of `fetch = +refs/pull/*/merge:refs/gh-merge/remotes/origin/*` which point to the merge commit of the respective pull request.\n",
"created_at": "2012-11-27T15:39:36Z",
"id": 608797,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo2MDg3OTc=",
"updated_at": "2012-11-27T15:39:36Z",
"url": "https://api.github.com/gists/3342247/comments/608797",
"user": {
"login": "havvg",
"id": 126898,
"node_id": "MDQ6VXNlcjEyNjg5OA==",
"avatar_url": "https://avatars2.githubusercontent.com/u/126898?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/havvg",
"html_url": "https://github.com/havvg",
"followers_url": "https://api.github.com/users/havvg/followers",
"following_url": "https://api.github.com/users/havvg/following{/other_user}",
"gists_url": "https://api.github.com/users/havvg/gists{/gist_id}",
"starred_url": "https://api.github.com/users/havvg/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/havvg/subscriptions",
"organizations_url": "https://api.github.com/users/havvg/orgs",
"repos_url": "https://api.github.com/users/havvg/repos",
"events_url": "https://api.github.com/users/havvg/events{/privacy}",
"received_events_url": "https://api.github.com/users/havvg/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "Anyone managed to work out how to actually remove the pull ref, for example:\ngit push origin :pr/1\ndoesn't seem to work\n",
"created_at": "2012-12-20T14:10:21Z",
"id": 662297,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo2NjIyOTc=",
"updated_at": "2012-12-20T14:10:21Z",
"url": "https://api.github.com/gists/3342247/comments/662297",
"user": {
"login": "tomjenkinson",
"id": 317340,
"node_id": "MDQ6VXNlcjMxNzM0MA==",
"avatar_url": "https://avatars1.githubusercontent.com/u/317340?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/tomjenkinson",
"html_url": "https://github.com/tomjenkinson",
"followers_url": "https://api.github.com/users/tomjenkinson/followers",
"following_url": "https://api.github.com/users/tomjenkinson/following{/other_user}",
"gists_url": "https://api.github.com/users/tomjenkinson/gists{/gist_id}",
"starred_url": "https://api.github.com/users/tomjenkinson/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/tomjenkinson/subscriptions",
"organizations_url": "https://api.github.com/users/tomjenkinson/orgs",
"repos_url": "https://api.github.com/users/tomjenkinson/repos",
"events_url": "https://api.github.com/users/tomjenkinson/events{/privacy}",
"received_events_url": "https://api.github.com/users/tomjenkinson/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "You can also use https://github.com/defunkt/hub and run `git checkout https://github.com/defunkt/hub/pull/73`\n",
"created_at": "2013-01-22T13:15:55Z",
"id": 742869,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo3NDI4Njk=",
"updated_at": "2013-01-22T13:15:55Z",
"url": "https://api.github.com/gists/3342247/comments/742869",
"user": {
"login": "pcreux",
"id": 45299,
"node_id": "MDQ6VXNlcjQ1Mjk5",
"avatar_url": "https://avatars2.githubusercontent.com/u/45299?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/pcreux",
"html_url": "https://github.com/pcreux",
"followers_url": "https://api.github.com/users/pcreux/followers",
"following_url": "https://api.github.com/users/pcreux/following{/other_user}",
"gists_url": "https://api.github.com/users/pcreux/gists{/gist_id}",
"starred_url": "https://api.github.com/users/pcreux/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/pcreux/subscriptions",
"organizations_url": "https://api.github.com/users/pcreux/orgs",
"repos_url": "https://api.github.com/users/pcreux/repos",
"events_url": "https://api.github.com/users/pcreux/events{/privacy}",
"received_events_url": "https://api.github.com/users/pcreux/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "Any reason for, when I do \n`git fetch origin --prune`\nit creates the pr local branches and it deletes them right after?\n\noutput:\n\n```\n * [new ref] refs/pull/1/head -> origin/pr/1\n * [new ref] refs/pull/2/head -> origin/pr/2\n x [deleted] (none) -> origin/pr/1\n x [deleted] (none) -> origin/pr/2\n```\n",
"created_at": "2013-02-02T04:45:07Z",
"id": 765117,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo3NjUxMTc=",
"updated_at": "2013-02-02T04:45:58Z",
"url": "https://api.github.com/gists/3342247/comments/765117",
"user": {
"login": "arthurnn",
"id": 833383,
"node_id": "MDQ6VXNlcjgzMzM4Mw==",
"avatar_url": "https://avatars1.githubusercontent.com/u/833383?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/arthurnn",
"html_url": "https://github.com/arthurnn",
"followers_url": "https://api.github.com/users/arthurnn/followers",
"following_url": "https://api.github.com/users/arthurnn/following{/other_user}",
"gists_url": "https://api.github.com/users/arthurnn/gists{/gist_id}",
"starred_url": "https://api.github.com/users/arthurnn/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/arthurnn/subscriptions",
"organizations_url": "https://api.github.com/users/arthurnn/orgs",
"repos_url": "https://api.github.com/users/arthurnn/repos",
"events_url": "https://api.github.com/users/arthurnn/events{/privacy}",
"received_events_url": "https://api.github.com/users/arthurnn/received_events",
"type": "User",
"site_admin": true
}
},
{
"author_association": "NONE",
"body": "@tomjenkinson did you ever figure out a solution to deleting them remotely, or to at least ignore those that are closed?\n",
"created_at": "2013-02-09T16:07:13Z",
"id": 770430,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo3NzA0MzA=",
"updated_at": "2013-02-09T16:07:13Z",
"url": "https://api.github.com/gists/3342247/comments/770430",
"user": {
"login": "jimi-c",
"id": 26403,
"node_id": "MDQ6VXNlcjI2NDAz",
"avatar_url": "https://avatars0.githubusercontent.com/u/26403?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/jimi-c",
"html_url": "https://github.com/jimi-c",
"followers_url": "https://api.github.com/users/jimi-c/followers",
"following_url": "https://api.github.com/users/jimi-c/following{/other_user}",
"gists_url": "https://api.github.com/users/jimi-c/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jimi-c/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jimi-c/subscriptions",
"organizations_url": "https://api.github.com/users/jimi-c/orgs",
"repos_url": "https://api.github.com/users/jimi-c/repos",
"events_url": "https://api.github.com/users/jimi-c/events{/privacy}",
"received_events_url": "https://api.github.com/users/jimi-c/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "@arthurnn The fetch line for pull requests needs to be before the one for heads. I wrote a small [shell function](https://github.com/jasoncodes/dotfiles/blob/a29509902cb839b6aaf26d2d5409d66199b86d1d/shell/aliases/git.sh#L93-L110) to do this.\n",
"created_at": "2013-02-19T06:19:16Z",
"id": 776888,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo3NzY4ODg=",
"updated_at": "2013-03-26T00:13:12Z",
"url": "https://api.github.com/gists/3342247/comments/776888",
"user": {
"login": "jasoncodes",
"id": 83466,
"node_id": "MDQ6VXNlcjgzNDY2",
"avatar_url": "https://avatars3.githubusercontent.com/u/83466?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/jasoncodes",
"html_url": "https://github.com/jasoncodes",
"followers_url": "https://api.github.com/users/jasoncodes/followers",
"following_url": "https://api.github.com/users/jasoncodes/following{/other_user}",
"gists_url": "https://api.github.com/users/jasoncodes/gists{/gist_id}",
"starred_url": "https://api.github.com/users/jasoncodes/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/jasoncodes/subscriptions",
"organizations_url": "https://api.github.com/users/jasoncodes/orgs",
"repos_url": "https://api.github.com/users/jasoncodes/repos",
"events_url": "https://api.github.com/users/jasoncodes/events{/privacy}",
"received_events_url": "https://api.github.com/users/jasoncodes/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "I just wanted to chime in and tell you about a tool I put together to work with pull requests from the command line.\n\nI know it's been done before, but I wanted to take a slightly different approach.\n\nIt's here: http://github.com/robinsmidsrod/App-GitHubPullRequest\n",
"created_at": "2013-03-06T18:44:59Z",
"id": 792536,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo3OTI1MzY=",
"updated_at": "2013-03-06T18:44:59Z",
"url": "https://api.github.com/gists/3342247/comments/792536",
"user": {
"login": "robinsmidsrod",
"id": 92816,
"node_id": "MDQ6VXNlcjkyODE2",
"avatar_url": "https://avatars2.githubusercontent.com/u/92816?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/robinsmidsrod",
"html_url": "https://github.com/robinsmidsrod",
"followers_url": "https://api.github.com/users/robinsmidsrod/followers",
"following_url": "https://api.github.com/users/robinsmidsrod/following{/other_user}",
"gists_url": "https://api.github.com/users/robinsmidsrod/gists{/gist_id}",
"starred_url": "https://api.github.com/users/robinsmidsrod/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/robinsmidsrod/subscriptions",
"organizations_url": "https://api.github.com/users/robinsmidsrod/orgs",
"repos_url": "https://api.github.com/users/robinsmidsrod/repos",
"events_url": "https://api.github.com/users/robinsmidsrod/events{/privacy}",
"received_events_url": "https://api.github.com/users/robinsmidsrod/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": ":+1:\n![](https://dl.dropbox.com/u/169422/Gifs/Ll3pyrr.gif)\n",
"created_at": "2013-03-22T14:50:40Z",
"id": 803529,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo4MDM1Mjk=",
"updated_at": "2013-03-22T14:50:40Z",
"url": "https://api.github.com/gists/3342247/comments/803529",
"user": {
"login": "sthulb",
"id": 103217,
"node_id": "MDQ6VXNlcjEwMzIxNw==",
"avatar_url": "https://avatars2.githubusercontent.com/u/103217?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/sthulb",
"html_url": "https://github.com/sthulb",
"followers_url": "https://api.github.com/users/sthulb/followers",
"following_url": "https://api.github.com/users/sthulb/following{/other_user}",
"gists_url": "https://api.github.com/users/sthulb/gists{/gist_id}",
"starred_url": "https://api.github.com/users/sthulb/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/sthulb/subscriptions",
"organizations_url": "https://api.github.com/users/sthulb/orgs",
"repos_url": "https://api.github.com/users/sthulb/repos",
"events_url": "https://api.github.com/users/sthulb/events{/privacy}",
"received_events_url": "https://api.github.com/users/sthulb/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "awesome!\n",
"created_at": "2013-03-25T10:13:56Z",
"id": 804767,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo4MDQ3Njc=",
"updated_at": "2013-03-25T10:13:56Z",
"url": "https://api.github.com/gists/3342247/comments/804767",
"user": {
"login": "hlysig",
"id": 223798,
"node_id": "MDQ6VXNlcjIyMzc5OA==",
"avatar_url": "https://avatars0.githubusercontent.com/u/223798?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/hlysig",
"html_url": "https://github.com/hlysig",
"followers_url": "https://api.github.com/users/hlysig/followers",
"following_url": "https://api.github.com/users/hlysig/following{/other_user}",
"gists_url": "https://api.github.com/users/hlysig/gists{/gist_id}",
"starred_url": "https://api.github.com/users/hlysig/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/hlysig/subscriptions",
"organizations_url": "https://api.github.com/users/hlysig/orgs",
"repos_url": "https://api.github.com/users/hlysig/repos",
"events_url": "https://api.github.com/users/hlysig/events{/privacy}",
"received_events_url": "https://api.github.com/users/hlysig/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": ":+1:\n",
"created_at": "2013-03-25T11:53:52Z",
"id": 804793,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo4MDQ3OTM=",
"updated_at": "2013-03-25T11:53:52Z",
"url": "https://api.github.com/gists/3342247/comments/804793",
"user": {
"login": "ypandit",
"id": 237417,
"node_id": "MDQ6VXNlcjIzNzQxNw==",
"avatar_url": "https://avatars0.githubusercontent.com/u/237417?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/ypandit",
"html_url": "https://github.com/ypandit",
"followers_url": "https://api.github.com/users/ypandit/followers",
"following_url": "https://api.github.com/users/ypandit/following{/other_user}",
"gists_url": "https://api.github.com/users/ypandit/gists{/gist_id}",
"starred_url": "https://api.github.com/users/ypandit/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/ypandit/subscriptions",
"organizations_url": "https://api.github.com/users/ypandit/orgs",
"repos_url": "https://api.github.com/users/ypandit/repos",
"events_url": "https://api.github.com/users/ypandit/events{/privacy}",
"received_events_url": "https://api.github.com/users/ypandit/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": ":heart:\n",
"created_at": "2013-03-25T12:01:23Z",
"id": 804799,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo4MDQ3OTk=",
"updated_at": "2013-03-25T12:01:23Z",
"url": "https://api.github.com/gists/3342247/comments/804799",
"user": {
"login": "Darep",
"id": 218910,
"node_id": "MDQ6VXNlcjIxODkxMA==",
"avatar_url": "https://avatars2.githubusercontent.com/u/218910?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/Darep",
"html_url": "https://github.com/Darep",
"followers_url": "https://api.github.com/users/Darep/followers",
"following_url": "https://api.github.com/users/Darep/following{/other_user}",
"gists_url": "https://api.github.com/users/Darep/gists{/gist_id}",
"starred_url": "https://api.github.com/users/Darep/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/Darep/subscriptions",
"organizations_url": "https://api.github.com/users/Darep/orgs",
"repos_url": "https://api.github.com/users/Darep/repos",
"events_url": "https://api.github.com/users/Darep/events{/privacy}",
"received_events_url": "https://api.github.com/users/Darep/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "<img src=\"http://i.imgur.com/dyalMsD.gif\"/>\n",
"created_at": "2013-03-25T12:16:49Z",
"id": 804803,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo4MDQ4MDM=",
"updated_at": "2013-03-25T12:16:49Z",
"url": "https://api.github.com/gists/3342247/comments/804803",
"user": {
"login": "iqbalhasnan",
"id": 794601,
"node_id": "MDQ6VXNlcjc5NDYwMQ==",
"avatar_url": "https://avatars1.githubusercontent.com/u/794601?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/iqbalhasnan",
"html_url": "https://github.com/iqbalhasnan",
"followers_url": "https://api.github.com/users/iqbalhasnan/followers",
"following_url": "https://api.github.com/users/iqbalhasnan/following{/other_user}",
"gists_url": "https://api.github.com/users/iqbalhasnan/gists{/gist_id}",
"starred_url": "https://api.github.com/users/iqbalhasnan/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/iqbalhasnan/subscriptions",
"organizations_url": "https://api.github.com/users/iqbalhasnan/orgs",
"repos_url": "https://api.github.com/users/iqbalhasnan/repos",
"events_url": "https://api.github.com/users/iqbalhasnan/events{/privacy}",
"received_events_url": "https://api.github.com/users/iqbalhasnan/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "The way I normally do this is just to add the other user as a remote: \n\n```\ngit remote add other_user other_user_repo_url\ngit fetch other_user\ngit checkout -b other_user_branch other_user/branch\n```\n\nNice, though!\n",
"created_at": "2013-03-25T13:17:22Z",
"id": 804819,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo4MDQ4MTk=",
"updated_at": "2013-03-25T13:17:22Z",
"url": "https://api.github.com/gists/3342247/comments/804819",
"user": {
"login": "joelmccracken",
"id": 10936,
"node_id": "MDQ6VXNlcjEwOTM2",
"avatar_url": "https://avatars0.githubusercontent.com/u/10936?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/joelmccracken",
"html_url": "https://github.com/joelmccracken",
"followers_url": "https://api.github.com/users/joelmccracken/followers",
"following_url": "https://api.github.com/users/joelmccracken/following{/other_user}",
"gists_url": "https://api.github.com/users/joelmccracken/gists{/gist_id}",
"starred_url": "https://api.github.com/users/joelmccracken/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/joelmccracken/subscriptions",
"organizations_url": "https://api.github.com/users/joelmccracken/orgs",
"repos_url": "https://api.github.com/users/joelmccracken/repos",
"events_url": "https://api.github.com/users/joelmccracken/events{/privacy}",
"received_events_url": "https://api.github.com/users/joelmccracken/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "ooh, I've been trying to figure this one out forever ! I strongly dislike just reading and clicking \"merge this\" without testing.\n",
"created_at": "2013-03-25T13:32:45Z",
"id": 804848,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo4MDQ4NDg=",
"updated_at": "2013-03-25T13:32:45Z",
"url": "https://api.github.com/gists/3342247/comments/804848",
"user": {
"login": "crucialfelix",
"id": 218738,
"node_id": "MDQ6VXNlcjIxODczOA==",
"avatar_url": "https://avatars1.githubusercontent.com/u/218738?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/crucialfelix",
"html_url": "https://github.com/crucialfelix",
"followers_url": "https://api.github.com/users/crucialfelix/followers",
"following_url": "https://api.github.com/users/crucialfelix/following{/other_user}",
"gists_url": "https://api.github.com/users/crucialfelix/gists{/gist_id}",
"starred_url": "https://api.github.com/users/crucialfelix/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/crucialfelix/subscriptions",
"organizations_url": "https://api.github.com/users/crucialfelix/orgs",
"repos_url": "https://api.github.com/users/crucialfelix/repos",
"events_url": "https://api.github.com/users/crucialfelix/events{/privacy}",
"received_events_url": "https://api.github.com/users/crucialfelix/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": ":rocket:\n",
"created_at": "2013-03-25T13:46:20Z",
"id": 804861,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo4MDQ4NjE=",
"updated_at": "2013-03-25T13:46:20Z",
"url": "https://api.github.com/gists/3342247/comments/804861",
"user": {
"login": "chadwhitacre",
"id": 134455,
"node_id": "MDQ6VXNlcjEzNDQ1NQ==",
"avatar_url": "https://avatars2.githubusercontent.com/u/134455?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/chadwhitacre",
"html_url": "https://github.com/chadwhitacre",
"followers_url": "https://api.github.com/users/chadwhitacre/followers",
"following_url": "https://api.github.com/users/chadwhitacre/following{/other_user}",
"gists_url": "https://api.github.com/users/chadwhitacre/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chadwhitacre/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chadwhitacre/subscriptions",
"organizations_url": "https://api.github.com/users/chadwhitacre/orgs",
"repos_url": "https://api.github.com/users/chadwhitacre/repos",
"events_url": "https://api.github.com/users/chadwhitacre/events{/privacy}",
"received_events_url": "https://api.github.com/users/chadwhitacre/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "Thank you\n",
"created_at": "2013-03-25T14:02:53Z",
"id": 804874,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo4MDQ4NzQ=",
"updated_at": "2013-03-25T14:02:53Z",
"url": "https://api.github.com/gists/3342247/comments/804874",
"user": {
"login": "JohnMcLear",
"id": 220864,
"node_id": "MDQ6VXNlcjIyMDg2NA==",
"avatar_url": "https://avatars2.githubusercontent.com/u/220864?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/JohnMcLear",
"html_url": "https://github.com/JohnMcLear",
"followers_url": "https://api.github.com/users/JohnMcLear/followers",
"following_url": "https://api.github.com/users/JohnMcLear/following{/other_user}",
"gists_url": "https://api.github.com/users/JohnMcLear/gists{/gist_id}",
"starred_url": "https://api.github.com/users/JohnMcLear/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/JohnMcLear/subscriptions",
"organizations_url": "https://api.github.com/users/JohnMcLear/orgs",
"repos_url": "https://api.github.com/users/JohnMcLear/repos",
"events_url": "https://api.github.com/users/JohnMcLear/events{/privacy}",
"received_events_url": "https://api.github.com/users/JohnMcLear/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "You can also try https://github.com/splitbrain/git-pull-request which shows you a list of pull requests.\n",
"created_at": "2013-03-25T14:12:58Z",
"id": 804890,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo4MDQ4OTA=",
"updated_at": "2013-03-25T14:12:58Z",
"url": "https://api.github.com/gists/3342247/comments/804890",
"user": {
"login": "mwhite",
"id": 344026,
"node_id": "MDQ6VXNlcjM0NDAyNg==",
"avatar_url": "https://avatars1.githubusercontent.com/u/344026?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/mwhite",
"html_url": "https://github.com/mwhite",
"followers_url": "https://api.github.com/users/mwhite/followers",
"following_url": "https://api.github.com/users/mwhite/following{/other_user}",
"gists_url": "https://api.github.com/users/mwhite/gists{/gist_id}",
"starred_url": "https://api.github.com/users/mwhite/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/mwhite/subscriptions",
"organizations_url": "https://api.github.com/users/mwhite/orgs",
"repos_url": "https://api.github.com/users/mwhite/repos",
"events_url": "https://api.github.com/users/mwhite/events{/privacy}",
"received_events_url": "https://api.github.com/users/mwhite/received_events",
"type": "User",
"site_admin": false
}
},
{
"author_association": "NONE",
"body": "For the record, pushing a locally-merged PR closed it in the GitHub UI. :sparkles:\n",
"created_at": "2013-03-25T14:54:56Z",
"id": 804929,
"node_id": "MDExOkdpc3RDb21tZW50MzM0MjI0Nzo4MDQ5Mjk=",
"updated_at": "2013-03-25T14:54:56Z",
"url": "https://api.github.com/gists/3342247/comments/804929",
"user": {
"login": "chadwhitacre",
"id": 134455,
"node_id": "MDQ6VXNlcjEzNDQ1NQ==",
"avatar_url": "https://avatars2.githubusercontent.com/u/134455?v=4",
"gravatar_id": 0,
"url": "https://api.github.com/users/chadwhitacre",
"html_url": "https://github.com/chadwhitacre",
"followers_url": "https://api.github.com/users/chadwhitacre/followers",
"following_url": "https://api.github.com/users/chadwhitacre/following{/other_user}",
"gists_url": "https://api.github.com/users/chadwhitacre/gists{/gist_id}",
"starred_url": "https://api.github.com/users/chadwhitacre/starred{/owner}{/repo}",
"subscriptions_url": "https://api.github.com/users/chadwhitacre/subscriptions",
"organizations_url": "https://api.github.com/users/chadwhitacre/orgs",
"repos_url": "https://api.github.com/users/chadwhitacre/repos",
"events_url": "https://api.github.com/users/chadwhitacre/events{/privacy}",
"received_events_url": "https://api.github.com/users/chadwhitacre/received_events",
"type": "User",
"site_admin": false
}
}
]

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 = [email protected]:joyent/node.git

Now add the line fetch = +refs/pull/*/head:refs/remotes/origin/pr/* to this section. Obviously, change the github url to match your project's URL. It ends up looking like this:

[remote "origin"]
	fetch = +refs/heads/*:refs/remotes/origin/*
	url = [email protected]:joyent/node.git
	fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

Now fetch all the pull requests:

$ git fetch origin
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'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment