Git clone without .git directory [duplicate]
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: How to do a “git export” (like “svn export”) Is there a flag to pass to git when doing a clone, say don't clone the .git directory? If not, how about a flag to delete the .git directory after the clone? 回答1: Use git clone --depth=1 --branch=master git://someserver/somerepo dirformynewrepo rm -rf ./dirformynewrepo/.git The depth option will make sure to copy the least bit of history possible to get that repo. The