Created
March 31, 2017 21:59
-
-
Save etoews/13471fad3a0f5e558ee57a9d27bf0426 to your computer and use it in GitHub Desktop.
prat: a bash function to rapidly submit a pull request
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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