Skip to content

Instantly share code, notes, and snippets.

@nicerobot
Last active December 19, 2015 15:49
Show Gist options
  • Select an option

  • Save nicerobot/5979367 to your computer and use it in GitHub Desktop.

Select an option

Save nicerobot/5979367 to your computer and use it in GitHub Desktop.
Find folders that are _not_ git repositories. This means, the parent folder of the .git directory is not reported by find.

I finally spent the time to figure this out. It's easier than I thought:

find . -type d -exec test -e {}/.git \; -prune -o -type d ! -path . -print
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment