From: SZEDER Gábor Date: Sat, 16 Mar 2019 01:51:15 GMT Subject: Re: protect .git folder/files from grep/sed commands Message-ID: <20190316015115.GB24175@szeder.dev> In-Reply-To: On Sat, Mar 16, 2019 at 01:37:39AM +0000, Dimitri Joukoff wrote: > When performing global changes in a project/tree using a command like: > > grep -r "search" | xargs -I {} sed -i '' s/search/replace/g > > there exists the possibility that this command will alter data in .git > folder. Using GNU grep, it is possible to use --exclude '/.*"' to avoid > the .git folder, but this flag is not available on BSD grep (i.e. MacOS). Try 'git grep "search" | ...'