Skip to content

Instantly share code, notes, and snippets.

@axolx
Created May 23, 2011 05:29
Show Gist options
  • Save axolx/986265 to your computer and use it in GitHub Desktop.
Save axolx/986265 to your computer and use it in GitHub Desktop.
Pull & update all git or mercurial repos in a directory (e.g. vim pathogen bundles)
for d in `ls -1`; do
if [ -d $d/.git ]; then
cd $d
git pull
cd ..
elif [ -d $d/.hg ]; then
cd $d
hg pull -u
cd ..
else
echo "$d is not a git or hg repo"
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment