Pedro Lopes
Pedro Lopes

Reputation: 2883

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

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?

Upvotes: 17

Views: 12920

Answers (3)

San Askaruly
San Askaruly

Reputation: 341

If downloading repo as .zip file is okay for you, here is a possible suggestion. It ended up working for me for to download a heavy project, while using a free Github account:

  1. Fork the repo to one of your users Go to repo settings
  2. Find "Include Git LFS objects in archives" under the Archives section and check it
  3. Go to the Danger Zone section, select "Archive this repository"
  4. Confirm and authorize.
  5. Return to the archived repository.
  6. Download as .zip
  7. Download will pause for a minute or so before it starts downloading lfs objects. Wait and it should continue.

Credits to a Git user from here:
(https://github.com/nabla-c0d3/nassl/issues/17#issuecomment-804149931)

Upvotes: 0

Lanchon
Lanchon

Reputation: 363

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.

Upvotes: 7

jmbejara
jmbejara

Reputation: 256

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.

Upvotes: 9

Related Questions