Skip to content

Instantly share code, notes, and snippets.

@nisanthchunduru
Last active July 26, 2017 14:47
Show Gist options
  • Save nisanthchunduru/eacbea7a9a1102fa89ce61c763830762 to your computer and use it in GitHub Desktop.
Save nisanthchunduru/eacbea7a9a1102fa89ce61c763830762 to your computer and use it in GitHub Desktop.
zsh function to quick convert an issue to a pull request

Run

issuetopr 1256

to convert issue 1256 to a pull request.

Copy the function issuetopr to your .bashrc or .zshrc to start using it.

Note: The script depends on hub. Install hub brew install hub if you don't have it.

issuetopr () {
git_branch=`git rev-parse --symbolic-full-name --abbrev-ref HEAD`
git_organization=`git config --get remote.origin.url | cut -d: -f2 | cut -d/ -f1`
hub pull-request -i $1 -h $git_organization:$git_branch
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment