Remove all git files from a directory?

前端 未结 7 1637
不思量自难忘°
不思量自难忘° 2021-01-30 12:17

I have a folder under version control. I want to make a copy of it to send around, but don\'t want to include all the .git directories and the files underneath it.

Is

7条回答
  •  醉话见心
    2021-01-30 12:59

    cd to the repository then

    find . -name ".git*" -exec rm -R {} \;
    

    Make sure not to accidentally pipe a single dot, slash, asterisk, or other regex wildcard into find, or else rm will happily delete it.

提交回复
热议问题