Skip to content

Instantly share code, notes, and snippets.

@damoclark
Last active August 29, 2015 14:24
Show Gist options
  • Save damoclark/d73ef8546b81bb0f4414 to your computer and use it in GitHub Desktop.
Save damoclark/d73ef8546b81bb0f4414 to your computer and use it in GitHub Desktop.
Show the origin of all git repos under the current working directory
#!/bin/sh
#Call this script like so:
# $ cd <location of all your repos>
# $ find . -type d -name .git -printf "%h\0"|xargs -0 -n 1 git-remote-show-origin-all.sh 2>/dev/null | sort
#Ignore any vendor repos
echo "$1" | grep -q vendor && exit
cd "$1"
echo -n "$1,"
git remote show origin |grep 'Push URL:'|sed -e 's/^.*Push URL: //'
echo ""
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment