Skip to content

Instantly share code, notes, and snippets.

@nandub
Created September 4, 2010 02:24
Show Gist options
  • Save nandub/564832 to your computer and use it in GitHub Desktop.
Save nandub/564832 to your computer and use it in GitHub Desktop.
Simple bash script to update all git-clone repos from a local directory
#!/bin/bash
f=$(pwd) # 'pwd' is "present working directory"
FOLDERS=`ls -d $f/*`
for f in $FOLDERS
do
if [ -d "$f/.git" ]; then
pushd $f
git pull
popd -n
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment