Skip to content

Instantly share code, notes, and snippets.

@rpetrich
Created April 16, 2011 14:50
Show Gist options
  • Save rpetrich/923160 to your computer and use it in GitHub Desktop.
Save rpetrich/923160 to your computer and use it in GitHub Desktop.
Pushes the local branch up to the origin and opens the github pull request form in the browser
#!/bin/sh
ORIGIN=$1
if [ -e $1 ] ; then
ORIGIN=origin
fi
BRANCH=`git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* \(.*\)/\1/'`
PROJECT=`git config --get remote.$ORIGIN.url | cut -f 2- -d : | cut -f 1 -d.`
git push $ORIGIN $BRANCH && open "https://github.com/$PROJECT/pull/new/$BRANCH"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment