Skip to content

Instantly share code, notes, and snippets.

@gpakosz
Created August 13, 2011 14:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gpakosz/1143906 to your computer and use it in GitHub Desktop.
Save gpakosz/1143906 to your computer and use it in GitHub Desktop.
Bulk update of SVN and Git repositories located under a common top level directory
#!/bin/sh
echo updating svn repositories
find . -type d -exec test -d '{}'/.svn.disabled \; -prune -o -exec test -d '{}'/.svn \; -prune -exec sh -c "echo updating {} && svn cleanup {} && svn update --non-interactive --trust-server-cert {}" \;
echo updating git repositories
find . -type d -exec test -d '{}'/.git \; -prune -exec sh -c "echo updating {} && cd {} && git clean -xdf && git pull" \;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment