-
-
Save mdigital/6445350 to your computer and use it in GitHub Desktop.
This file contains 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
function pr () { | |
target_branch=$1 | |
local repo=`git remote -v | grep -m 1 "(push)" | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"` | |
local branch=`git name-rev --name-only HEAD` | |
echo "... creating pull request for branch \"$branch\" in \"$repo\"" | |
if [[ ! -z $target_branch ]]; then | |
open https://github.com/$repo/pull/new/$target_branch...$branch | |
else | |
open https://github.com/$repo/pull/new/$branch | |
fi | |
} | |
1 | |
export -f pr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment