Skip to content

Instantly share code, notes, and snippets.

@jbharter
Created October 30, 2018 13:32
Show Gist options
  • Save jbharter/98dd2da8df50d151a361712634c7196a to your computer and use it in GitHub Desktop.
Save jbharter/98dd2da8df50d151a361712634c7196a to your computer and use it in GitHub Desktop.
Do you have a bunch of git repositories in a directory, and want to get them all up to date in one fell swoop? There's a script for that.
#!/bin/bash
for d in */;
do
echo $d
cd $d
git fetch
git pull
if [ $? -ne 0 ];
then
git stash
git pull
fi
cd ..
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment