Created
June 25, 2018 09:57
-
-
Save benkroeger/54cadf6a9d5c9c34e3b703c50aed607d to your computer and use it in GitHub Desktop.
Creates a list of all directories that are git repositories and (if available) print their remote `origin` url
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
#!/usr/bin/env bash | |
for D in *; do | |
if [ -d $D ]; then | |
cd $D | |
if [ -d .git ] || git rev-parse --git-dir > /dev/null 2>&1; then | |
echo "${D}: $(git remote get-url --push origin)" | |
fi | |
cd .. | |
fi | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment