Last active
August 29, 2015 14:19
-
-
Save joshkunz/766ba153eb936f85a05a to your computer and use it in GitHub Desktop.
One-Liner to check the integrity of all git repos in the current directory
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
find . -name '.git' -type d -prune \ | |
| rev | cut -d '/' -f2- | rev | tr '\n' '\0' \ | |
| xargs -0 -n1 -I% bash -c 'echo -n "%..."; cd "%"; git fsck 2>/dev/null 1>&2; if [ $? -eq "0" ]; then printf "\e[32mPASS\e[39m\n"; else printf "\e[31mFAIL\e[39m\n"; fi' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment