-
-
Save cwaring/7930464 to your computer and use it in GitHub Desktop.
Simple command line tool to open up a pull request (into the dev branch) from your current local branch.
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
#!/bin/bash | |
open=$(which xdg-open 2> /dev/null) | |
if [[ ! $open ]]; then | |
open='open' | |
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/compare/dev...$branch?expand=1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment