git lfs: Usage, Options & Common CI Errors
git lfs replaces large files in your repo with small pointers, storing the real content separately.
LFS keeps repos small but adds a fetch step. CI that forgets it ends up with pointer files instead of real assets.
What it does
git lfs is an extension that swaps large files for text pointers tracked in Git, while the binary content lives on an LFS server and is fetched on checkout when LFS is installed.
Common usage
git lfs install
git lfs track "*.psd"
git lfs pull # download LFS objects
git lfs ls-files
git lfs fetch --allOptions
| Subcommand | What it does |
|---|---|
| install | Set up the LFS Git hooks |
| track <pattern> | Track a path pattern with LFS |
| pull | Fetch and check out LFS content |
| ls-files | List LFS-managed files |
| fetch --all | Download all LFS objects |
Common errors in CI
Files contain "version https://git-lfs.github.com/spec/v1" text instead of real content - LFS objects were not pulled. Run git lfs install then git lfs pull (in actions/checkout set lfs: true). "batch response: This repository is over its data quota" means LFS bandwidth/storage limits were hit.