clone github仓库时,如何只克隆仓库的一部分?
有的github仓库文件特别多,只想clone一部分文件,该如何做到呢?
7 回复
谢谢楼上,在提问之前我已经在google和stackoverflow上搜索了很久,这篇帖子我也看到了,并且尝试了好几次,貌似行不通,输入这个命令:git remote add -f origin <url> 之后就开始完全拷贝了!
@jowang2016 It is an improvement but still needs to download and store a full copy of the remote repository in origin, which one might like to avoid at all if he is interested only in portions of the codebase (or if there is documentation subfolders as in my case)
貌似确实会拷贝所有的内容
@jowang2016 如果觉得仓库太大了,还有一个方法可以只拷贝最新的版本
git clone --depth=1 <remote_repo_url>
@xcatliu 感谢!我再试试!