Fetch PR by ID to a local branch

This commit is contained in:
Samar Panda 2015-10-28 16:24:02 +05:30
parent c4f2cbbc44
commit f89a062f72
2 changed files with 17 additions and 0 deletions

View File

@ -65,6 +65,7 @@
* [Get the name of current branch.](https://github.com/git-tips/tips#get-the-name-of-current-branch)
* [Ignore one file on commit (e.g. Changelog).](https://github.com/git-tips/tips#ignore-one-file-on-commit-eg-changelog)
* [Stash changes before rebasing](https://github.com/git-tips/tips#stash-changes-before-rebasing)
* [Fetch pull request by ID to a local branch](https://github.com/git-tips/tips#fetch-pull-request-by-id-to-a-local-branch)
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end toc -->
@ -455,5 +456,16 @@ git update-index --assume-unchanged Changelog; git commit -a; git update-index -
git rebase --autostash
```
## Fetch pull request by ID to a local branch
```sh
git fetch origin pull/<id>/head:<branch-name>
```
__Alternatives:__
```sh
git pull origin pull/<id>/head:<branch-name>
```
<!-- Dont remove or change the comment below that can break automatic updates. More info at <http://npm.im/doxie.inject>. -->
<!-- @doxie.inject end -->

View File

@ -259,5 +259,10 @@
{
"title": "Stash changes before rebasing",
"tip": "git rebase --autostash"
},
{
"title": "Fetch pull request by ID to a local branch",
"tip": "git fetch origin pull/<id>/head:<branch-name>",
"alternatives": ["git pull origin pull/<id>/head:<branch-name>"]
}
]