Skip to content
Permalink
master
Switch branches/tags
Go to file
 
 
Cannot retrieve contributors at this time
executable file 15 lines (10 sloc) 251 Bytes
#!/usr/bin/env bash
# git-fetch-pr: fetch a pull request and check it out as a branch
set -eo pipefail
usage() {
echo "usage: git fetch-pr <pr #>"
exit
}
[[ -z "${1}" ]] && usage
git fetch origin "pull/${1}/head:pr-${1}"
git checkout "pr-${1}"