Created
August 4, 2013 21:18
-
-
Save jasdeepkhalsa/6151996 to your computer and use it in GitHub Desktop.
A shell script which can be added to Cron to update all git repos automatically
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/bash | |
# Just change the FILES path below to the parent directory of where all your git repos reside | |
FILES=/dir/to/code/* | |
for f in $FILES | |
do | |
if [ -d $f ] && [ -d $f/.git ] | |
then | |
echo "Processing Git repository, $f" | |
cd $f | |
git --git-dir="$f/.git" pull -q | |
fi; | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment