Created
October 28, 2019 23:39
-
-
Save tscritch/4a13eebae8cb9ef4862a0497071db39c to your computer and use it in GitHub Desktop.
Open Github PR from Shell
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // add to your ~/.bash_profile or ~/.zsh_profile to run anywhere | |
| pr() { | |
| github_url=`git remote -v | awk '/fetch/{print $2}' | sed -Ee 's#(git@|git://)#https://#' -e 's@com:@com/@' -e 's%\.git$%%' | awk '/github/'` | |
| branch_name=`git symbolic-ref HEAD | cut -d'/' -f 3,4` | |
| pr_url=$github_url"/pull/new/"$branch_name | |
| open $pr_url | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment