Skip to content

Instantly share code, notes, and snippets.

@beporter
Created August 10, 2015 22:04
Show Gist options
  • Save beporter/2f4b35435f0107d7b330 to your computer and use it in GitHub Desktop.
Save beporter/2f4b35435f0107d7b330 to your computer and use it in GitHub Desktop.
Find all git repos (folders containing a `.git/` subdirectory) in the provided path (defaults to current directory.)
#!/usr/bin/env bash
#
# Find and list all git repos (folders containing .git/ directories)
# in the provided path (defaults to current dir.)
#
# Designed to run on a Mac, so make sure you have GNU `findutils`
# and the `terminal-notifier` gem installed.
#
# [email protected]
# v1.0 2015-08-10
SEARCH_PATH=${1:-"."}
echo "This could take a while. I'll notify you when done." 1>&2
gfind "${SEARCH_PATH%/}" -name .git -type d -prune -not \( -path "*/vendor*" -prune \) -printf "%h\n"
terminal-notifier -sound default -message 'Git repo search complete. Check your Terminal window.'
@justinyost
Copy link

Throws an error if you use it in iTerm at least for me.
screen shot 2015-08-10 at 3 56 31 pm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment