Skip to content
Latchkey

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

Terminal
git lfs install
git lfs track "*.psd"
git lfs pull                       # download LFS objects
git lfs ls-files
git lfs fetch --all

Options

SubcommandWhat it does
installSet up the LFS Git hooks
track <pattern>Track a path pattern with LFS
pullFetch and check out LFS content
ls-filesList LFS-managed files
fetch --allDownload 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.

Related guides

Run this faster and cheaper on Latchkey managed runners. Start free →