Created
April 15, 2016 14:18
-
-
Save Elijen/9421d8e632ca8492dec9e17a4d41c1a3 to your computer and use it in GitHub Desktop.
Automatically push, create PR and assign team members for review
This file contains 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
#!/bin/bash -ex | |
UNCOMMITED_CHANGES=$(git diff-index --name-only HEAD --) | |
if [ -n "$UNCOMMITED_CHANGES" ]; then | |
echo "Repo has uncommited changes, proceed anyway? (y/N)" | |
read FORCE | |
if [ "$FORCE" = "y" -o "$FORCE" = "Y" ]; then | |
echo "Continuing..." | |
else | |
echo "Exiting..." | |
exit | |
fi | |
fi | |
echo "Pushing to origin/`git rev-parse --abbrev-ref HEAD`" | |
git push origin HEAD | |
MEMBERS=$(git config stash.`git config stash.team`.members) | |
stash pull-request ${1:-master} $MEMBERS |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment