Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Pull Request handling
# Checkout a PR from the current repo
function copr { git fetch origin pull/$1/head:pr-$1; git checkout pr-$1; }
# Get the current PR from the branch name
function current_pr {
git rev-parse --abbrev-ref HEAD | grep -oE "\d+"
# Update the PR
function upr {
echo "Pulling for PR: $pr"
git pull origin pull/$pr/head
# Open the PR in the browser
function opr {
echo "Opening PR: $pr"
open "$pr"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.