Skip to content

Instantly share code, notes, and snippets.

@georgebashi
Created September 22, 2011 16:59
Show Gist options
  • Save georgebashi/1235341 to your computer and use it in GitHub Desktop.
Save georgebashi/1235341 to your computer and use it in GitHub Desktop.
handy script for working with multiple repos
#!/bin/sh
cmd="$1"
if [ $# -gt 1 ]; then
shift 1
files=$@
else
files=`find . -depth 1 -type d -not -name '.*' | cut -c 3-`
fi
for worktree in $files; do
echo "Updating $worktree..."
(cd $worktree && git $cmd)
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment