Skip to content

Instantly share code, notes, and snippets.

@RomkeVdMeulen
Created February 4, 2015 20:33
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save RomkeVdMeulen/5978f733f6d48542fa62 to your computer and use it in GitHub Desktop.
Save RomkeVdMeulen/5978f733f6d48542fa62 to your computer and use it in GitHub Desktop.
Script for automatically updating a number of projects in your workspace
#!/bin/bash
###############################################
# #
# Auto-update externals #
# #
# Will go into your workspace (~/workspace) #
# and `git pull` all projects listed in #
# .git-auto-pull, and will `svn up` all #
# projects listed in .svn-auto-up #
# #
###############################################
cd ~/workspace/
if [ -f .git-auto-pull ]; then
for project in `cat .git-auto-pull | tr "\n" ' '`; do
echo "Updating $project..."
cd $project
git branch
git pull
cd - > /dev/null
echo
done
fi
if [ -f .svn-auto-up ]; then
for project in `cat .svn-auto-up | tr "\n" ' '`; do
echo "Updating $project..."
cd $project
svn up
cd - > /dev/null
echo
done
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment