Skip to content

Instantly share code, notes, and snippets.

Embed
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 {
pr=$(current_pr)
echo "Pulling for PR: $pr"
git pull origin pull/$pr/head
}
# Open the PR in the browser
function opr {
pr=$(current_pr)
echo "Opening PR: $pr"
open "https://github.com/serverless/serverless/pull/$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.