Created
September 28, 2017 19:49
-
-
Save DaneWeber/5ae74e964718f75f29594cde87bc9200 to your computer and use it in GitHub Desktop.
Quick status on all git repos in a directory. Based on this answer: https://unix.stackexchange.com/a/394245/63051
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
# Run the following from a directory containing multiple git repositories | |
# The `28` in the printf command is arbitrary and just matches the number of characters in the longest-named repo I have. | |
function repo_states () { | |
for repo in */; do | |
printf '%-28s' "$repo" | |
( cd "$repo" && git status --short --branch --untracked-files=no ) | |
done | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example output (local branch in green and origin branch in red):