Skip to content

Instantly share code, notes, and snippets.

@wesgarrison
Created April 30, 2014 15:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wesgarrison/d1b74e4b6ab6791e9a3d to your computer and use it in GitHub Desktop.
Save wesgarrison/d1b74e4b6ab6791e9a3d to your computer and use it in GitHub Desktop.
Make pull request from an issue
# template
curl --user "<gh-username>" \
--request POST \
--data '{"issue": "<issue-number>", "head": "<owner>:<branch>", "base": "master"}' \
https://api.github.com/repos/<owner>/<repo>/pulls
# example
curl --user "wesgarrison" \
--request POST \
--data '{"issue": "1", "head": "databasically:00001-my-new-feature", "base": "master"}' \
https://api.github.com/repos/databasically/databasicallydotcom/pulls
@darrencauthon
Copy link

@ferrislucas Check this out.

@baweaver
Copy link

getIssue() {
  curl --user "$1" \
  --request POST \
  --data '{"issue": "$2", "head": "$3:$4", "base": "master"}' \
  "https://api.github.com/repos/$3/$5/pulls"
}

getIssue wesgarrison 1 databasically 00001-my-new-feature databasicallydotcom

Like that? If you're in the branch / working directory you can just use a few commands to automatically get that data as well. Current repo and branch are easy to pull, as well as github username.

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