Skip to content

Instantly share code, notes, and snippets.

@jasdeepkhalsa
Created August 4, 2013 21:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save jasdeepkhalsa/6151996 to your computer and use it in GitHub Desktop.
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
#!/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