Created
December 15, 2014 20:43
-
-
Save tmos/5ec08aae48ce6fa05105 to your computer and use it in GitHub Desktop.
Update all git repos under the current folder
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/sh | |
clear | |
count=0 | |
for i in * | |
do | |
if [ -d "$i" ] | |
then | |
cd "$i" | |
if [ -d ".git" ] | |
then | |
echo "" | |
echo "#####$i#####" | |
output=$(git pull) | |
echo $output | |
# listing of updated repos | |
if [ "$output" != "Already up-to-date." ] | |
then | |
count=$((count+1)) | |
majs="$majs \n $i" | |
fi | |
fi | |
cd .. | |
fi | |
done | |
echo "" | |
echo "" | |
if [ $count -gt 0 ] | |
then | |
echo "$count repos updated :" | |
echo -e "$majs" | |
else | |
echo "No news here :(" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment