Skip to content

Instantly share code, notes, and snippets.

@keriati
Created May 20, 2018 17:54
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 keriati/b9904c7aeae83b385223530569da46ba to your computer and use it in GitHub Desktop.
Save keriati/b9904c7aeae83b385223530569da46ba to your computer and use it in GitHub Desktop.
gpr() {
NEWLINE=$'\n';
lastCommitMessage=$(git log -1 --pretty=%B);
ticketNumber=$(echo $lastCommitMessage | cut -d ":" -f2 | cut -d " " -f2);
message=$(<./.github/PULL_REQUEST_TEMPLATE.md);
messageReplaced=$(sed -e "s/GEOR-xxx/$ticketNumber/g" <<< $message);
hub pull-request -m "$lastCommitMessage$NEWLINE$messageReplaced" -o;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment