protect .git folder/files from grep/sed commands

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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).

Maybe git and the .git folder within a repository should be configured
to use a separate user account, and then the .git folder would have its
permissions set to 600?







[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux