Skip to content

Instantly share code, notes, and snippets.

@MattesGroeger
Created May 16, 2011 20:31
Show Gist options
  • Save MattesGroeger/975301 to your computer and use it in GitHub Desktop.
Save MattesGroeger/975301 to your computer and use it in GitHub Desktop.
Run this script to switch branches for multiple projects at the same time. Execute script with terminal command "sh switch_branch.sh".
#! /bin/sh
# path to local branch workspace
branch="/Users/user/Documents/workspaces/workspace_project_branch"
# path to remote branch
remotebranch="https://svnhoster/project/branches"
# modules
MODULE[0]="client_core"
MODULE[1]="client_module_game"
MODULE[2]="client_module_popup"
MODULE[3]="client_module_sound"
# get iteration number
echo "Please enter target branch iteration number (e.g. 12):"
read iteration
echo "Start switching to"
echo " $remotebranch/iteration_$iteration"
for ((i=0;i<=3;i++))
do
cd "$branch/${MODULE[$i]}"
echo "... switching ${MODULE[$i]}"
svn switch "$remotebranch/iteration_$iteration/client/${MODULE[$i]}"
echo "... DONE"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment