-
-
Save bitmage/20243dcc8e73232547126e253f6a6e00 to your computer and use it in GitHub Desktop.
git status recursively
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/bash | |
shopt -s globstar | |
for repo in ./**/.git; do | |
dir=`dirname "$repo"` | |
printf "$dir:\n" | |
export GIT_DIR="$repo" | |
export GIT_WORK_TREE="$dir" | |
git log --branches --not --remotes --simplify-by-decoration --decorate --oneline | |
git status --short | |
done |
Updated version uses globstar instead of find. Works with file names containing spaces.
Updated version uses globstar instead of find. Works with file names containing spaces.
Now also prints out status of whether the repo has been pushed.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Current usecase: I'm reinstalling my OS and want to know what errant git repos I should sync before nuking it.