Skip to content

Instantly share code, notes, and snippets.

@arabek
Created January 28, 2020 09:02
Show Gist options
  • Save arabek/455cc05076c4d6cbbd85b51646fc98f1 to your computer and use it in GitHub Desktop.
Save arabek/455cc05076c4d6cbbd85b51646fc98f1 to your computer and use it in GitHub Desktop.
a simple script to checkout a numbered pull req
#!/bin/bash
if [ x$1 == x ]; then
echo "no pull request ref number specified at command line";
exit 1;
else
git fetch origin +refs/pull/$1/merge:;
git checkout -qf FETCH_HEAD;
git checkout -b $1;
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment