nisanth074
7/26/2017 - 12:15 AM

zsh function to quick convert an issue to a pull request

zsh function to quick convert an issue to a pull request

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
}

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.