From: Duy Nguyen Date: Wed, 25 Feb 2015 13:46:37 GMT Subject: Re: feature request: excluding files/paths from "git grep" Message-ID: In-Reply-To: <54EDBEC2.8090107@peralex.com> On Wed, Feb 25, 2015 at 7:23 PM, Noel Grandin wrote: > What would be nice is a per-user/repo config setting that excludes certain > files and paths from the 'git grep' search. > > Does this sound reasonable/acceptable? There is no config setting to do that, but since v1.9.5 you can use ':!' or ':(exclude) to exclude paths, for example git grep foo -- '*.c' ':!src/ ':!*foo*.c' will exclude .c files in src directory or contains "foo". If you use some exclude patterns often, you can write a short script. Perhaps we could support pathspec macros (similar to git-attr macros), stored in config file. You still need to type, but it'll be a lot shorter. -- Duy