Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

git

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?

like image 471
Pedro Lopes Avatar asked Sep 25 '16 21:09

Pedro Lopes


People also ask

How do I clone a git repository LFS?

Once Git LFS is installed, you can clone a Git LFS repository as normal using git clone . At the end of the cloning process Git will check out the default branch (usually main ), and any Git LFS files needed to complete the checkout process will be automatically downloaded for you.

Can I clone a repository without git?

Degit is a tool created by Rich Harris, the creator of Svelte and Rollup, which he uses to quickly create a new project by cloning a repository without keeping the git folder. But it can also be used to clone any repo once...

Does everyone install git LFS?

You have to have the Git LFS client installed in order for its filter programs to be invoked by Git, check for locks, and report their existence. Otherwise it's just a normal Git repo underneath.

Is git LFS necessary?

Should I Use Git LFS? You should use Git LFS if you have large files or binary files to store in Git repositories. That's because Git is decentralized. So, every developer has the full change history on their computer.


2 Answers

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.

like image 115
Lanchon Avatar answered Sep 18 '22 08:09

Lanchon


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.

like image 31
jmbejara Avatar answered Sep 19 '22 08:09

jmbejara