Skip to content

Instantly share code, notes, and snippets.

@jph00
Last active September 25, 2022 15:42
  • Star 10 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
Update in parallel all repos listed in ~/git/repos, and print status of any that are dirty
#!/usr/bin/env bash
for f in $(<~/git/repos); do
cd ~/git/$f
git pull > /dev/null &
cd - > /dev/null
done
wait < <(jobs -p)
for f in $(<~/git/repos); do
cd ~/git/$f
r=$(git status -s)
if [[ $r = *[!^[:space:]]* ]]; then
cat <<EOF
=====
$f
$r
EOF
fi
cd - > /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment