Created
October 31, 2012 02:25
-
-
Save mariusbutuc/3984446 to your computer and use it in GitHub Desktop.
My first "real" bash script
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
#! /bin/bash | |
clear | |
case "$2" in | |
master) branches=(test develop master);; | |
dev) branches=(test develop);; | |
*) branches=(test);; | |
esac | |
for branch in ${branches[*]} | |
do | |
printf "\n\n\t Synchronizing with %s\n" $branch | |
git checkout $branch | |
git pull origin $branch | |
git merge --no-ff $1 | |
git push origin $branch | |
done | |
printf "\n\n\t All done here, returning to %s\n" $1 | |
git checkout $1 | |
printf "\n\n\t BBye!\n" | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment