Created
February 10, 2017 09:00
-
-
Save PVince81/f58f6dfd6cf54c4a6ba9322187873180 to your computer and use it in GitHub Desktop.
Open the Github Pull Request page for the current branch with optional target branch
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
#!/bin/bash | |
# Inspired by http://www.devthought.com/code/create-a-github-pull-request-from-the-terminal/ | |
targetbranch=master | |
if test "$1"; then | |
targetbranch=$1 | |
fi | |
repo=`git remote -v | grep -m 1 "(push)" | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"` | |
branch=`git name-rev --name-only HEAD` | |
echo "Creating pull request for branch \"$branch\" in \"$repo\"" | |
xdg-open "https://github.com/$repo/pull/new/$targetbranch...$branch" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment