网上讲的sparse checkout方法并没有什么用,因为稀疏检出的方法依旧克隆了全部仓库的历史记录。 最新的git 2.19之后才能够实现克隆部分文件 参考了这个答主的方法:https://stackoverflow.com/questions/600079/git-how-do-i-clone-a-subdirectory-only-of-a-git-repository/52269934#52269934
|
|
原理就是好像只下载了索引文件。 如果要clone某个分支或者commit的文件,只要在checkout检出那里设置就行了。
git checkout <branchname> -- d1
git checkout <commitid> -- d1

说些什么吧!