Created
February 9, 2026 17:50
-
-
Save wteuber/a343328d77fb76bd24f37dc2127ed237 to your computer and use it in GitHub Desktop.
Check git status of all git repos
This file contains hidden or 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 | |
| # Loop over everything in the current directory | |
| for d in */; do | |
| # Skip if there are no directories | |
| [ -d "$d" ] || continue | |
| # Strip trailing slash for nicer output | |
| dir="${d%/}" | |
| echo "========== $dir ==========" | |
| # Check if it's a git repo (.git directory present) | |
| if [ -d "$dir/.git" ]; then | |
| echo "[GIT REPO]" | |
| ( cd "$dir" && git status ) | |
| else | |
| echo "Not a git repository." | |
| fi | |
| echo | |
| done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment