From f89a062f722820a5d6a5617f56649e650d188c19 Mon Sep 17 00:00:00 2001 From: Samar Panda Date: Wed, 28 Oct 2015 16:24:02 +0530 Subject: [PATCH] Fetch PR by ID to a local branch --- README.md | 12 ++++++++++++ tips.json | 5 +++++ 2 files changed, 17 insertions(+) diff --git a/README.md b/README.md index edd9746..39cf0b3 100644 --- a/README.md +++ b/README.md @@ -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) @@ -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//head: +``` + + +__Alternatives:__ +```sh +git pull origin pull//head: +``` + diff --git a/tips.json b/tips.json index e3abadc..3f445ba 100644 --- a/tips.json +++ b/tips.json @@ -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//head:", + "alternatives": ["git pull origin pull//head:"] } ]