Last active
May 28, 2020 21:31
-
-
Save douglasnaphas/01f01089bb4da05cc5988930582a1db1 to your computer and use it in GitHub Desktop.
Print repos in subdirectories of the current directory that are not on master or have dirty working directories
This file contains hidden or 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
for d in $(ls) ; do | |
if [[ ! -d ${d}/.git ]] ; then | |
continue ; | |
fi | |
BRANCH="$(git -C ${d} rev-parse --abbrev-ref HEAD)" ; | |
if [[ "${BRANCH}" != "master" ]] ; then | |
echo ${d} "${BRANCH}" ; | |
continue ; | |
fi | |
if [[ $(git -C ${d} status --porcelain 2>/dev/null | wc -l) -ne 0 ]] ; then | |
echo ${d} ; | |
continue ; | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment