Skip to content

Instantly share code, notes, and snippets.

@shillcock
Created May 7, 2009 19:41
Show Gist options
  • Select an option

  • Save shillcock/108310 to your computer and use it in GitHub Desktop.

Select an option

Save shillcock/108310 to your computer and use it in GitHub Desktop.
#!/bin/sh
if [ ! "$1" = "" ] ; then
if [ "$GITREPO" = "" -a -d "$HOME/cm/src" ] ; then
GITREPO="$HOME/cm/src"
fi
if [ "$GITREPO" != "" ] ; then
echo "Git repositories found in $GITREPO"
echo "-=-=-=-=-=-=-=-=-=-=-=-=-=-"
DIRS="`/bin/ls -1 $GITREPO`"
for dir in $DIRS ; do
if [ -d $GITREPO/$dir/.git ] ; then
echo "$dir -> git $1"
cd $GITREPO/$dir ; git $@
echo
fi
done
else
echo "Git repositories not found."
fi
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment