Git LFS (Large File Storage)
Why a 2GB model checkpoint doesn't belong directly in git — and what to do instead.
Intermediate
.git/objects
forever (see Git Internals). That's fine for text — diffs of
source code are small. It's a disaster for a binary file that changes often: a 500MB
dataset re-saved 20 times isn't 500MB of history, it's up to 10GB, and none of it
compresses or diffs well since it's binary.
.gitattributes file at the repo root —
that file is what actually needs to be committed and shared; git lfs track
is just the command that edits it for you correctly.
git add, git commit, and
git push work exactly as before — LFS intercepts matching files
transparently. The only visible difference is what a clone downloads.
track alone won't fix that.
git lfs migrate.