Skip to content

Instantly share code, notes, and snippets.

@versedi
Last active April 19, 2016 06:27
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 versedi/ac41ba6e152984f6fc2fcaaac7e2e7af to your computer and use it in GitHub Desktop.
Save versedi/ac41ba6e152984f6fc2fcaaac7e2e7af to your computer and use it in GitHub Desktop.
Show branches for all subdirectories repos in current directory
#!/bin/bash
for D in *; do
if [ -d "${D}" ]; then
if [ -d "${D}/.git" ]; then
echo
echo --------------
echo
echo -e "\033[1m${D}\033[0m"
echo
cd ${D} && git branch \ && cd ../
fi
fi
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment