当使用 Git LFS 将大文件推送到 git 存储库时,系统上没有安装 git-lfs 的用户可以在没有任何额外设置的情况下克隆它吗?
小智 8
我只是试着按照你的建议去做。我使用 Git LFS 创建了一个存储 .csv 文件的存储库。我将 repo 推送到 GitHub。然后,在没有安装 Git LFS 的系统上,我尝试克隆 repo 并收到一条错误消息,指出未找到“git lfs”命令:
? 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'
Run Code Online (Sandbox Code Playgroud)
一旦我安装了 Git LFS,它就工作得很好。因此,您似乎需要系统上的 git lfs 来克隆存储库。
您绝对可以在不安装 lfs 的情况下克隆 lfs 存储库。事实上,git lfs clone现在已被弃用。lfs 实际上只在您结帐时才重要,而不是在克隆时重要。如果您在没有 lfs 的情况下结帐(这可能在克隆期间发生),您将获得包含引用的占位符文件,而不是真正的大文件。