Skip to content

Instantly share code, notes, and snippets.

@atsmith813
Last active May 11, 2018 15:56
Show Gist options
  • Save atsmith813/da088bf28e38e7c31c52d2ca5bda6321 to your computer and use it in GitHub Desktop.
Save atsmith813/da088bf28e38e7c31c52d2ca5bda6321 to your computer and use it in GitHub Desktop.
Open pull request from the command line.
function open_pr() {
if [ $# -eq 1 ]
then
br=$(git rev-parse --abbrev-ref HEAD)
else
br=$2
fi
open "https://github.com/$(git remote get-url origin | awk -F '[:.]' '{print $3}')/compare/$1...$br?expand=1"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment