Skip to content

Instantly share code, notes, and snippets.

@gunnarx
Created March 20, 2017 16:53
Show Gist options
  • Save gunnarx/7452caad6d5e94d3093491ebadbade1a to your computer and use it in GitHub Desktop.
Save gunnarx/7452caad6d5e94d3093491ebadbade1a to your computer and use it in GitHub Desktop.
# Shell function to pull a PR into a branch to study it locally
# ...original from unkonwn source (but probably from GitHub documentation)
review_pr ()
{
[ -z "$1" ] && {
echo "reviewpull <pull-request-number>";
return 1
};
echo "git fetch origin pull/$1/head:pr_$1"
git fetch origin pull/$1/head:pr_$1
echo "git checkout pr_$1"
git checkout pr_$1
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment