Skip to content

Commit 6ac9a17

Browse files
committed
Merge pull request #38 from samarpanda/modify_pr_locally
Fetch PR by ID to a local branch!
2 parents c4f2cbb + f89a062 commit 6ac9a17

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

README.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -65,6 +65,7 @@
6565
* [Get the name of current branch.](https://github.com/git-tips/tips#get-the-name-of-current-branch)
6666
* [Ignore one file on commit (e.g. Changelog).](https://github.com/git-tips/tips#ignore-one-file-on-commit-eg-changelog)
6767
* [Stash changes before rebasing](https://github.com/git-tips/tips#stash-changes-before-rebasing)
68+
* [Fetch pull request by ID to a local branch](https://github.com/git-tips/tips#fetch-pull-request-by-id-to-a-local-branch)
6869

6970
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
7071
<!-- @doxie.inject end toc -->
@@ -455,5 +456,16 @@ git update-index --assume-unchanged Changelog; git commit -a; git update-index -
455456
git rebase --autostash
456457
```
457458

459+
## Fetch pull request by ID to a local branch
460+
```sh
461+
git fetch origin pull/<id>/head:<branch-name>
462+
```
463+
464+
465+
__Alternatives:__
466+
```sh
467+
git pull origin pull/<id>/head:<branch-name>
468+
```
469+
458470
<!-- Don’t remove or change the comment below – that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
459471
<!-- @doxie.inject end -->

tips.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -259,5 +259,10 @@
259259
{
260260
"title": "Stash changes before rebasing",
261261
"tip": "git rebase --autostash"
262+
},
263+
{
264+
"title": "Fetch pull request by ID to a local branch",
265+
"tip": "git fetch origin pull/<id>/head:<branch-name>",
266+
"alternatives": ["git pull origin pull/<id>/head:<branch-name>"]
262267
}
263268
]

0 commit comments

Comments
 (0)