Skip to content

Instantly share code, notes, and snippets.

@adomingues
Created December 24, 2020 13:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adomingues/e557aae2bcd27e455e5e3c3a66b29116 to your computer and use it in GitHub Desktop.
Save adomingues/e557aae2bcd27e455e5e3c3a66b29116 to your computer and use it in GitHub Desktop.
crawl all sub-directories wich are git repos and list those with more than one branch
parent=$(pwd)
for repo in $(find ${parent} -maxdepth 2 -name ".git" -type d | sed 's/.git//'); do
cd ${repo}
n=$(git branch | wc -l)
if [[ ${n} -gt 1 ]]; then
echo ${repo}
fi
cd ${parent}
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment