Last active
September 10, 2019 08:05
-
-
Save Auronmatrix/527d658dfa338db479060c523fe55490 to your computer and use it in GitHub Desktop.
get-branch-of-all-git-repos-in-subfoldera
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 | |
LOOK_FOR='.git' | |
find . -name $LOOK_FOR -print0 | xargs -0 -n1 dirname | sort --unique | while read fname; do | |
( | |
cd $fname | |
echo $(git rev-parse --abbrev-ref HEAD) " | " $fname | |
) | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment