Last active
November 3, 2023 17:03
-
-
Save rlcamp/2b2e0e722c58473e45c7ad7e2b2d84a7 to your computer and use it in GitHub Desktop.
list git repos with uncommitted or unpushed changes
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
#!/bin/sh | |
set -e | |
for repo in $(find . -mindepth 2 -type d -name '.git' | sed -e 's/\/.git//'); do | |
(cd $repo && | |
git diff --exit-code HEAD && | |
git log --decorate --oneline | head -n1 | grep origin | |
) 1>/dev/null || printf '"%s" has uncommitted or unpushed changes\n' $(basename $repo) >&2 | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment