Last active
September 25, 2022 15:42
-
-
Save jph00/7ab8813d795521d919bc4f10b4937169 to your computer and use it in GitHub Desktop.
Update in parallel all repos listed in ~/git/repos, and print status of any that are dirty
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/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