简体   繁体   中英

How do I checkout just a source tree from git (without the repo history, etc.)

I am working with a git repository that is over a 100GB when it is checked out. I don't have enough space on disk to keep the whole repo around, and I only need read access to it, I will never submit. How can I get git to just checkout the current state of the files, and not the entire history?

Try a shallow clone:

git clone --depth 1 <repository>

That will clone with a history depth of 1 revision, not the full history of the repository.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM