Skip to content

Instantly share code, notes, and snippets.

@nathanrice
Last active December 17, 2015 22:09
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save nathanrice/5679587 to your computer and use it in GitHub Desktop.
Save nathanrice/5679587 to your computer and use it in GitHub Desktop.
Convert GitHub issue into a Pull Request
# Replace [username] with your GitHub username (in both places).
# Replace [project]/[repository] with the project and repository where the issue resides.
# Replace [base] with the destination branch you wish to PR to (usually master or develop)
# And obviously, don't leave the [] brackets in there.
# Usage:
# @git-pr 999 features/999
# Where 999 is the issue you wish to attach a PR to, and features/999 is the branch you wish to use for the PR.
function @git-pr() {
curl --user "[username]" --request POST --data '{"issue": "'$1'", "head": "[username]:'$2'", "base": "[base]"}' https://api.github.com/repos/[project]/[repository]/pulls
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment