Skip to content

Instantly share code, notes, and snippets.

@etoews etoews/prat.sh
Created Mar 31, 2017

Embed
What would you like to do?
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
You can’t perform that action at this time.