Skip to content

Instantly share code, notes, and snippets.

@wteuber
Created February 9, 2026 17:50
Show Gist options
  • Select an option

  • Save wteuber/a343328d77fb76bd24f37dc2127ed237 to your computer and use it in GitHub Desktop.

Select an option

Save wteuber/a343328d77fb76bd24f37dc2127ed237 to your computer and use it in GitHub Desktop.
Check git status of all git repos
#!/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