Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git clone lfs files not fully downloading

Tags:

git

git-lfs

I have an issue, where if I run git clone I have some binary files in LFS, those files will clone but will be very small like 130 bytes when in reality they should be 100mb. When I go on Github it shows that they are 100mb. When I press download on Github it shows that they are 100mb.

When I do git lfs clone it will be correct.

If after I git clone I do:

git lfs pull origin [BRANCH]

It will also get all the files with the correct size.

I'm really confused what is going on here?

Whats the difference between git lfs clone and git clone? Why does it clone the files correctly with git LFS, but not regular git.

like image 442
bink1time Avatar asked Jan 28 '26 09:01

bink1time


2 Answers

The files that you're seeing in the working tree are Git LFS pointer files. They're the objects stored in the repository that get turned into the large files by Git LFS.

Normally, the files are checked out properly if you've run git lfs install, which registers the Git LFS smudge and clean filters with Git so that Git invokes them properly. If you haven't run that or otherwise configured the filters, then Git doesn't know to invoke Git LFS, and your files won't be checked out unless you ask Git LFS to do it for you.

So to fix this problem, run git lfs install, which should configure your repository appropriately. This should modify your ~/.gitconfig, so you'll only need to run it once per system.

like image 84
bk2204 Avatar answered Jan 31 '26 02:01

bk2204


I finally found out why my submodule was not cloned fully:

In my .gitattributes the filter for my image files is

*.jpg filter=lfs diff=lfs merge=lfs -text

However the images files all have capital letters in their extension: *.JPG

Adding another line to .gitattributes for capitalized .JPG files solved the problem. The filters in the main repository were all correct; therefore the problem didn't occur there!

like image 39
fhw72 Avatar answered Jan 31 '26 04:01

fhw72



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!