Skip to content

Instantly share code, notes, and snippets.

@mariusbutuc
Created October 31, 2012 02:25
Show Gist options
  • Save mariusbutuc/3984446 to your computer and use it in GitHub Desktop.
Save mariusbutuc/3984446 to your computer and use it in GitHub Desktop.
My first "real" bash script
#! /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