Skip to content

Instantly share code, notes, and snippets.

@d-a-v
Created September 7, 2019 16:26
Show Gist options
  • Save d-a-v/801cdfcf56d813dca2ff7b23f620c9d3 to your computer and use it in GitHub Desktop.
Save d-a-v/801cdfcf56d813dca2ff7b23f620c9d3 to your computer and use it in GitHub Desktop.
Try a github Pull-Request
#!/bin/sh
test -z "$2" && { echo "syntax: $0 <PR-number> <temporary-name>"; exit 1; }
set -ex
git checkout master
git branch -D pr-$1-$2
git fetch origin pull/$1/head:pr-$1-$2
git checkout pr-$1-$2
set +x
echo "### Pull request #$1 should be here in current branch 'pr-$1-$2':"
git branch | grep pr-$1-$2
@d-a-v
Copy link
Author

d-a-v commented Dec 12, 2019

(depending on the setup, one may replace origin by upstream)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment