Skip to content

Instantly share code, notes, and snippets.

@Quantium
Last active December 21, 2015 07:49
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Quantium/6274041 to your computer and use it in GitHub Desktop.
Save Quantium/6274041 to your computer and use it in GitHub Desktop.
This is a little shell script for update, join and run gitstats on several repositories in order to see only one gitstats project
#!/bin/sh
echo --------
allrepos='';
c=0;
for D in ~/repos/*;do
if [ -d "${D}" ];
then
cd "${D}";
pwd;
#Can't exist a repository with the name 'www'"
if [ ${D} = ~/repos/www ];
then
echo "Can't exist a repository with the name 'www'";
else
git pull;
allrepos="${D} ${allrepos}";
fi;
c=$(echo "$c + 1" | bc);
fi;
done;
#Not used anymore:
#allrepos=$(echo $allrepos | cut -d " " -f 2-$c)
gitstats $allrepos ~/www
echo $c updated repositories
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment