Can one clone a Git LFS repo without installing Git LFS?

不羁岁月 提交于 2019-12-21 17:28:38

问题


When using Git LFS to push large files to git repository, can a user which does not have git-lfs installed on its system clone it without any additional setup?


回答1:


I just tried to do what you suggested. I created a repository that stores .csv files using Git LFS. I pushed the repo to GitHub. Then, on a system that doesn't have Git LFS installed, I tried to clone the repo and received an error saying that the "git lfs" command was not found:

λ git clone https://github.com/myusername/git_lfs_tests.git
Cloning into 'git_lfs_tests'...
remote: Counting objects: 11, done.
remote: Compressing objects: 100% (9/9), done.
remote: Total 11 (delta 2), reused 10 (delta 1), pack-reused 0
Unpacking objects: 100% (11/11), done.
git-lfs filter-process: git-lfs: command not found
fatal: The remote end hung up unexpectedly
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

Once I installed Git LFS, it worked just fine. So, it appears that you need git lfs on the system to clone the repo.




回答2:


you can definitely clone an lfs repo without lfs installed. in fact, git lfs clone is now deprecated. lfs really only matters when you checkout, not when you clone. if you checkout without lfs (which could happen during a clone), you will get placeholder files containing references instead of the real large files.



来源:https://stackoverflow.com/questions/39691929/can-one-clone-a-git-lfs-repo-without-installing-git-lfs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!