Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@etoews
Created March 31, 2017 21:59
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 etoews/13471fad3a0f5e558ee57a9d27bf0426 to your computer and use it in GitHub Desktop.
Save etoews/13471fad3a0f5e558ee57a9d27bf0426 to your computer and use it in GitHub Desktop.
prat: a bash function to rapidly submit a pull request
# Usage: prat my-feature-branch "My commit (and pull request message)"
# Requirements: https://hub.github.com/
function prat()
{
BRANCH=${1:-}
MESSAGE=${2:-}
git diff
read -e -p "You sure? " SURE
if [[ "$SURE" == "y" ]]; then
git checkout -b $BRANCH
git add .
git commit -m "$MESSAGE"
git push -u
PR_URL=$(hub pr -m "$MESSAGE")
echo $PR_URL
open $PR_URL
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment