-
-
Save karlhorky/88b3c8c258796cd3eb97615da36e07be to your computer and use it in GitHub Desktop.
Revisions
-
karlhorky revised this gist
Jun 21, 2020 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,7 @@ You may not need local branches for **all** pull requests in a repo. To fetch only the ref of a single pull request that you need, use this: ```sh git fetch origin pull/7324/head:pr-7324 -
karlhorky revised this gist
Jun 21, 2020 . 1 changed file with 10 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,7 +2,16 @@ You may not need local branches for **all** pull requests in a repo. To fetch only the branch that you need, use this: ```sh git fetch origin pull/7324/head:pr-7324 git checkout pr-7324 # ... git branch -D pr-7324 ``` Or, another option is this: [Fetch and delete refs to GitHub pull request branches](https://gist.github.com/karlhorky/0c454c0c6f894c27911ed5de58d65416) If you do for some reason need all pull request branches locally, continue on. -
karlhorky revised this gist
Aug 3, 2016 . No changes.There are no files selected for viewing
-
karlhorky revised this gist
Aug 3, 2016 . No changes.There are no files selected for viewing
-
karlhorky revised this gist
Aug 3, 2016 . 1 changed file with 9 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,12 @@ **NOTE** You may not need local branches for **all** pull requests in a repo. To fetch only the branch that you need, use [Fetch and delete refs to GitHub pull request branches](https://gist.github.com/karlhorky/0c454c0c6f894c27911ed5de58d65416) If you do for some reason need all pull request branches locally, continue on. --- Locate the section for your github remote in the `.git/config` file. It looks like this: -
karlhorky revised this gist
Aug 3, 2016 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,4 @@ **NOTE:** To fetch only the branch that you need, use [Fetch and delete refs to GitHub pull request branches](https://gist.github.com/karlhorky/0c454c0c6f894c27911ed5de58d65416) Locate the section for your github remote in the `.git/config` file. It looks like this: -
karlhorky revised this gist
Aug 3, 2016 . 1 changed file with 2 additions and 0 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,3 +1,5 @@ **NOTE** To fetch only the branch that you need, use [Fetch and delete refs to GitHub pull request branches](https://gist.github.com/karlhorky/0c454c0c6f894c27911ed5de58d65416) Locate the section for your github remote in the `.git/config` file. It looks like this: ``` -
piscisaureus revised this gist
Aug 13, 2012 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -12,7 +12,7 @@ Now add the line `fetch = +refs/pull/*/head:refs/remotes/origin/pr/*` to this se [remote "origin"] fetch = +refs/heads/*:refs/remotes/origin/* url = git@github.com:joyent/node.git fetch = +refs/pull/*/head:refs/remotes/origin/pr/* ``` Now fetch all the pull requests: -
piscisaureus revised this gist
Aug 13, 2012 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,4 +1,3 @@ Locate the section for your github remote in the `.git/config` file. It looks like this: ``` @@ -32,8 +31,7 @@ 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' ``` -
piscisaureus created this gist
Aug 13, 2012 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,39 @@ 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 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 = git@github.com: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 D:\node4>git checkout pr/999 Branch pr/999 set up to track remote branch pr/1300 from origin. Switched to a new branch 'pr/999' ```