22 January 2022
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.
git checkout --orphan
git ls-tree <commit-id>
git tag <tagname> <blob-id>
git push origin --tags
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.