Skip to content

Instantly share code, notes, and snippets.

@vojtajina
Created May 8, 2013 04:19
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save vojtajina/5538170 to your computer and use it in GitHub Desktop.
Save vojtajina/5538170 to your computer and use it in GitHub Desktop.
Bash script for fetching a pull request from github...
# 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