Isa Dzhumabaev
Isa Dzhumabaev

Reputation: 49

Git LFS fails with small files

Suppose I have files of different size of type .bin These files may be large and small.

I want to use git lfs to work with big binary files. I have folder in which i want to init my repo. Its Content: enter image description here

I want LFS to track all files of type .bin because they can be large and there are lot of them in a project. That is why I created .gitattributes and added .bin type there.

I have file A.bin of size 13 MB and file B.bin of size 132 Bytes. I wrote the following script for this question.

git init --initial-branch=main
git lfs install
git add -A
git commit -m 'initial commit'
git remote add origin <my-repo-url>
git push --set-upstream origin main

It work when I copy A.bin into folder, but fails with B.bin. Message:

LFS upload failed:
  (missing) B.bin (489a843398d18a6a259886c01cbd86aee92e8764ceea7f77447604ff148cee8f)
Your push was rejected due to missing or corrupt local objects

Upvotes: -1

Views: 535

Answers (1)

Isa Dzhumabaev
Isa Dzhumabaev

Reputation: 49

I figured out the problem. Turned out that file B.bin had following content

version https://git-lfs.github.com/spec/v1
oid sha256:489a843398d18a6a259886c01cbd86aee92e8764ceea7f77447604ff148cee8f
size 1859

I dont know how this content came there, it was binary. Seems like this text gives some directives to LFS and that is why I had problems.

Upvotes: 1

Related Questions