Created
February 13, 2018 10:42
-
-
Save settermjd/c46b8838bce61648af5d3ee277f56208 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
#!/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\"" | |
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