Created
February 22, 2019 11:43
-
-
Save jbarrett/3e98c6742641eaca456aece62bd9d809 to your computer and use it in GitHub Desktop.
Git command : checkout PR
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
#!/usr/bin/env bash | |
[ -z "$1" ] && echo PR number required. && exit 1 | |
BRANCHNAME=pr$1 | |
[ ! -z "$2" ] && BRANCHNAME=$2 | |
git fetch origin pull/$1/head:$BRANCHNAME | |
git checkout $BRANCHNAME |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment