Skip to content

Instantly share code, notes, and snippets.

@a2
Created October 24, 2011 19:16
Show Gist options
  • Save a2/1309879 to your computer and use it in GitHub Desktop.
Save a2/1309879 to your computer and use it in GitHub Desktop.
Git pull in all subdirectories if directory is repo
for f in *;
do
echo "$f";
if [ -d "$f" ];
then
cd "$f";
if [ -d ".git" ];
then
git pull --all;
else
echo "Not a git repository...";
fi;
cd ../;
else
echo "Not a directory...";
fi
echo "";
done
for f in *; do echo "$f"; if [ -d "$f" ]; then cd "$f"; if [ -d ".git" ]; then git pull --all; else echo "Not a git repository..."; fi; cd ../; else echo "Not a directory..."; fi echo ""; done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment