Skip to content

Instantly share code, notes, and snippets.

@Elijen
Created April 15, 2016 14:18
Show Gist options
  • Save Elijen/9421d8e632ca8492dec9e17a4d41c1a3 to your computer and use it in GitHub Desktop.
Save Elijen/9421d8e632ca8492dec9e17a4d41c1a3 to your computer and use it in GitHub Desktop.
Automatically push, create PR and assign team members for review
#!/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