Skip to content

Instantly share code, notes, and snippets.

@mujahidk
Created August 20, 2018 19:16
Show Gist options
  • Save mujahidk/856dd7ac5c96a5e414e5826943112397 to your computer and use it in GitHub Desktop.
Save mujahidk/856dd7ac5c96a5e414e5826943112397 to your computer and use it in GitHub Desktop.
Fetch all Git project repositories under a directory.
for d in ./*/ ; do
(
echo "Processing directory '$d'";
if [ -d "$d/.git" ]; then
cd "$d" && git fetch --all
else
echo " ** Not a Git repository!"
fi;
echo "Completed '$d'"
echo '-----------------------------'
echo ''
);
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment