Skip to content

Instantly share code, notes, and snippets.

@svenax
Created July 26, 2017 08:32
Show Gist options
  • Save svenax/fdea072cd6146dcd5e96c33fa45eea61 to your computer and use it in GitHub Desktop.
Save svenax/fdea072cd6146dcd5e96c33fa45eea61 to your computer and use it in GitHub Desktop.
#!/bin/bash
PREFIX="${1%/}"
if [ -z "$PREFIX" ]; then
PREFIX="."
fi
for D in $PREFIX/*/; do
pushd "${D}" &> /dev/null
if [ -d ".git" ]; then
echo "Updating ${D}"
if [ -d ".git/svn" ]; then
git svn rebase
else
git pull
fi
fi
popd &> /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment