Or just use "grep". It is what it's there for.
Use --include and --exclude-dirs to do what you describe. (The latter is a good idea to set in your GREP_OPTIONS, unless you actually search .git directories.)
Use --include and --exclude-dirs to do what you describe. (The latter is a good idea to set in your GREP_OPTIONS, unless you actually search .git directories.)
(I don't think there's any such plan for the various BSD greps, so if you use those exclusively you're probably fine.)