Skip to content

Instantly share code, notes, and snippets.

@tommymarshall
Created January 29, 2018 19:44
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tommymarshall/c5dc984a901445739cbafe95cc2508f8 to your computer and use it in GitHub Desktop.
Save tommymarshall/c5dc984a901445739cbafe95cc2508f8 to your computer and use it in GitHub Desktop.
Create a PR against master from your the branch you're in, and open it in the browser.
pr () {
local repo=`git remote -v | grep -m 1 "origin" | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"`
local branch=`git name-rev --name-only HEAD`
echo "... creating pull request for branch \"$branch\" in \"$repo\""
open https://github.com/$repo/pull/new/$branch
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment