Skip to content

Git LFS

Keeps big binaries out of the repository history and stores pointers instead.

Homebrew formula Direct download

What it does

Git stores every version of every file forever, which makes a repository containing video, RAW photos or disk images unusable within months. LFS replaces tracked binaries with small text pointers; the real objects live on a separate LFS endpoint and are fetched on checkout.

git lfs install                 # one-time, per machine
git lfs track "*.mp4" "*.braw"
git add .gitattributes
git lfs ls-files

Notes

  • Tracking must be set up before committing the file; converting existing history needs git lfs migrate (a history rewrite).
  • GitHub’s LFS storage and bandwidth are metered separately from repository size, and bandwidth is the quota people actually hit.

Alternative to

AlternativeTypeTrade-off
git-annexOpen sourceMore flexible, considerably harder to learn
DVCOpen sourceBuilt for datasets and ML pipelines rather than assets
Perforce HelixPaidWhat studios use when binaries are the majority of the repository
Keeping binaries out of Git entirely—Object storage plus a manifest, and often the right call

Install

brew install git-lfs

Links

This post is licensed under CC BY 4.0 by the author.
Last updated on