Skip to content

Instantly share code, notes, and snippets.

@claudioc
Created October 22, 2014 14:50
Show Gist options
  • Save claudioc/5114554f68e5a026c26d to your computer and use it in GitHub Desktop.
Save claudioc/5114554f68e5a026c26d to your computer and use it in GitHub Desktop.
Easy pull request (needs hub)
#!/bin/bash
B=$(git rev-parse --abbrev-ref HEAD)
M=$(git log -n1 --format=format:%s)
DEF_TITLE="${M} - ${B}"
read -e -p "Provide the issue number: " ISSUEN
read -e -p "Provide a meaningful title [${DEF_TITLE}]: " TITLE
TITLE="${TITLE:-$DEF_TITLE}"
echo
echo hub pull-request -m \"${ISSUEN} ${TITLE}\" -h claudioc:${B}
echo hub pull-request -m \"${ISSUEN} ${TITLE}\" -h claudioc:${B} | pbcopy
echo Copied in your clipboard.
echo
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment