This file contains 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
git_pr() { | |
if [ -z "$1" ] || [ -z "$2" ] || [ -z "$3" ] ; then | |
echo "Missing required arguments:" | |
echo "1 - origin/upstream (remote where PR exists, not the fork)" | |
echo "2 - pull request ID (e.g. '42' without quotation)" | |
echo "3 - local branch to fetch onto (must not already exist)" | |
else | |
if git fetch $1 pull/$2/head:$3 ; then | |
git checkout $3 | |
else |