Skip to content

Instantly share code, notes, and snippets.

Last active June 6, 2016 19:25
  • Star 5 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
Star You must be signed in to star a gist
What would you like to do?
Add pull request to existing issue on github
current_branch="$(git symbolic-ref HEAD 2>/dev/null)" || current_branch="(unknown)"
if [[ $current_branch = "(unknown)" ]]
echo "Unable to determine current branch!"
exit 1
echo "Project owner:"
echo " (the guy or the company which must accept your pull request)"
echo " ( -> symfony)"
read owner
echo "Project name:"
echo " ( -> TwigBundle)"
read project
echo "Issue number:"
read issue
echo "Base commit / branch (usually master):"
read base
curl \
-d "{ \"base\": \"$base\", \"head\": \"$github_username:$current_branch\", \"issue\": \"$issue\"}" \
-u "$github_token:x-oauth-basic" \$owner/$project/pulls
Copy link

PetrP commented Apr 20, 2012

HEAD must be on the branch which contains the pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment