Created
May 8, 2013 04:19
-
-
Save vojtajina/5538170 to your computer and use it in GitHub Desktop.
Bash script for fetching a pull request from github...
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 characters
# fetching a single pull request from github | |
# put it into ~/.profile or ~/.bashrc | |
function fetch_pr() { | |
PR=$1 | |
BRANCH=$2 | |
if [ -z $PR ]; then | |
echo "Missing pull request number" | |
return 1 | |
fi | |
if [ -z $BRANCH ]; then | |
BRANCH="pr-$PR" | |
fi | |
git fetch upstream pull/$PR/head:$BRANCH | |
git checkout $BRANCH | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment