9

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.

nik7
  • 806
  • 3
  • 12
  • 20
bink1time
  • 383
  • 1
  • 5
  • 15

2 Answers2

4

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.

bk2204
  • 64,793
  • 6
  • 84
  • 100
0

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!

fhw72
  • 1,066
  • 1
  • 11
  • 19