Skip to content

Instantly share code, notes, and snippets.

@RandalSchwartz
Last active October 16, 2022 02:27
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 RandalSchwartz/ce3396f9c3376dbfe3afd316fb5c09d4 to your computer and use it in GitHub Desktop.
Save RandalSchwartz/ce3396f9c3376dbfe3afd316fb5c09d4 to your computer and use it in GitHub Desktop.
update a series of git repos in a subdirectory, then see which one has the most recent commits
#!/bin/zsh
for i in */.git; do (
echo "====== $i:h ======"
cd $i:h &&
git pull
); done
for i in */.git; do
(
cd $i:h &&
git log -1 --all --date=iso-local --format='%ad' |
read x
echo "$x $i:h"
)
done | sort -r
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment