Skip to content

Instantly share code, notes, and snippets.

@sunnyratilal
Forked from nathanrice/.profile
Created May 30, 2013 19:03
Show Gist options
  • Save sunnyratilal/5680271 to your computer and use it in GitHub Desktop.
Save sunnyratilal/5680271 to your computer and use it in GitHub Desktop.
# Replace [username] with your GitHub username.
# 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