Skip to content

Instantly share code, notes, and snippets.

@wrzlbrmft
Created March 29, 2016 11:43
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wrzlbrmft/ac2354d4a9a3c5349609 to your computer and use it in GitHub Desktop.
Save wrzlbrmft/ac2354d4a9a3c5349609 to your computer and use it in GitHub Desktop.
Do a git pull and status in all direct subdirectories being Git repos.
#!/usr/bin/env sh
_IFS="$IFS"
IFS=$'\n'
for i in $(find . -mindepth 1 -maxdepth 1 -type d | sort); do
if [ -d "$i/.git" ]; then
printf "$i: "
cd "$i"
git fetch
git pull
git status --short
cd ..
fi
done
IFS="$_IFS"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment