Skip to content

Instantly share code, notes, and snippets.

@relistan
Last active August 29, 2015 13:57
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 relistan/9648383 to your computer and use it in GitHub Desktop.
Save relistan/9648383 to your computer and use it in GitHub Desktop.
Inspect the remotes for a directory full of git repos, filtering for newrelic
#!/bin/bash
REPOS=""
for config in `find . -maxdepth 3 -name config | grep '.git'`; do
egrep "github.com:newrelic|github.com/newrelic" $config > /dev/null
if [[ $? -eq 0 ]]; then
repo_dir=`dirname $(dirname ${config})`
REPOS="${REPOS} `basename ${repo_dir}`"
fi
done
echo "Processing: $REPOS"
for repo in $REPOS; do
cd $repo > /dev/null
echo "$repo: "
git remote -v show
# PUT YOUR STUFF HERE
cd - > /dev/null
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment