Skip to content

Instantly share code, notes, and snippets.

@millerdev millerdev/git-pr
Last active Aug 29, 2015

Embed
What would you like to do?
git pr - Fetch GitHub pull request to a new branch
#! /bin/bash
if [ -z "$1" ]; then
echo "Fetch GitHub pull request to a new branch"
echo ""
echo "usage: git pr PULL_REQUEST_NUMBER [BRANCH_NAME]"
exit;
fi
pr_num="$1"
if [ -z "$2" ]; then
branch_name=pull-request-"$pr_num"
else
branch_name="$2"
fi
git fetch origin pull/$pr_num/head:$branch_name
@millerdev

This comment has been minimized.

Copy link
Owner Author

commented Jun 23, 2014

Create this script somewhere in your path. Don't forget to chmod +x /path/to/git-pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.