Skip to content

Instantly share code, notes, and snippets.

@lsjroberts
Created September 5, 2013 22:25
Show Gist options
  • Save lsjroberts/6457106 to your computer and use it in GitHub Desktop.
Save lsjroberts/6457106 to your computer and use it in GitHub Desktop.
Create pull request on existing issue from HEAD
issue= head=HEAD base=master
while getopts i:h:b: opt; do
case $opt in
i)
issue=$OPTARG
;;
h)
head=$OPTARG
;;
b)
base=$OPTARG
;;
esac
done
origin=$(git config --get remote.origin.url)
githubSSH="git@github.com:"
githubSuffix=".git"
origin=${origin/$githubSSH}
origin=${origin/$githubSuffix}
curl -d "{'issue': $issue, 'head': $head, 'base': $base}" -i https://api.github.com/repos/$origin/pulls
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment