Created
October 16, 2013 16:46
-
-
Save alexeypegov/7010987 to your computer and use it in GitHub Desktop.
Quick Github Pull Request for current branch. Place this script somewhere in PATH and call it like "git pr"
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/sh | |
function pr() { | |
local repo=`git remote -v | grep -m 1 "(push)" | sed -e "s/.*github.com[:/]\(.*\)\.git.*/\1/"` | |
if [ -n "$repo" ]; then | |
local branch=`git name-rev --name-only HEAD` | |
echo "... creating pull request for branch \"$branch\" in \"$repo\"" | |
open https://github.com/$repo/pull/new/$branch | |
fi | |
} | |
pr |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment