[如果github存储库(例如/ user / myRepository)具有由Git LFS管理的大数据文件,当我们使用git clone https://github.com/user/myRepository.git
复制存储库(在客户端上安装了git-lfs时,我们将获得整个存储库) (包括大文件),并且可能会很长。
如果您想仅快速克隆代码(不包含大文件),是否有不恢复大文件的解决方案?
我天真的尝试做:
git lfs uninstall
执行之前:
git clone https://github.com/user/myRepository.git
并且花了很长时间,并且大文件被克隆了...
我正在寻找一个简单的方法,例如:
我想要大文件,我愿意:
git lfs install
git clone https://github.com/user/myRepository.git
我想变得更快,不需要大文件,我做到了:
git lfs uninstall
git clone https://github.com/user/myRepository.git
您可以在克隆时设置环境变量GIT_LFS_SKIP_SMUDGE=1
,然后在以后要检出大文件时使用git lfs pull
下拉大文件。
git-lfs-config(5)
手册页中记录了环境变量。