Cheap git lfs alternative

2022-01-22 @equalsraf

How to store large files in git without lfs ... if you have no other option

So today I was in need of an alternative to git lfs. LFS has its own limitations, it needs server support and special handling for authentication via HTTPS.

I did not have the time to work around these, and the end result was this hack of a process.

To retrieve the file you can then use:

$ git cat-file blob <tagname> > filename

This does NOT address all issues that git-lfs does, but at least the file is a single object and requires zero support on the server side.

The downside is that a git clone is still expensive, but at least you can manually delete those files.

I have not checked yet, but maybe a combination of git clone --no-tags; or --single-branch can avoid the expensive fetch.

References

git-lfs