Created
November 9, 2012 13:41
-
-
Save Bertrand/4045714 to your computer and use it in GitHub Desktop.
merge master into staging and staging into testing
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/sh | |
git diff --quiet --exit-code | |
if [ $? -ne 0 ]; then | |
echo "Cannot run grrr if you have uncommited changes" | |
exit -1; | |
fi | |
current_branch=`git rev-parse --abbrev-ref HEAD` | |
if [ "$current_branch" == "HEAD" ]; then | |
echo "Cannot run grrrr if you're not on a branch" | |
exit -1; | |
fi | |
git checkout master && git pull --ff-only && git checkout staging && git pull --ff-only && git merge master && git push && git checkout testing && git pull --ff-only && git merge staging && git push | |
git checkout "$current_branch" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment