Skip to content
Latchkey

How to Handle Large Binaries in CI Without Bloating Clones

Filter out heavy blobs with --filter=blob:limit=, keep binaries in LFS, or pull them from an external store instead of the clone.

Large binaries dominate clone size and every checkout pays for them. Options are a size-limited partial clone that skips them, moving them to Git LFS, or keeping them out of git entirely and fetching from object storage in the job that needs them.

Options

ApproachHowTrade-off
Size-limited clone--filter=blob:limit=1mlazily fetches big blobs only when read
Git LFSstore binaries as LFS objectsseparate bandwidth quota to manage
External storedownload from S3/GCS in the jobnot versioned with the commit

Skip large blobs on clone

Terminal
git clone --filter=blob:limit=1m https://github.com/org/large-repo.git

Fetch a binary from external storage

.github/workflows/ci.yml
- run: aws s3 cp s3://build-assets/models/model.bin ./assets/model.bin

Gotchas

  • A size-limited clone still fetches a big blob the moment a step reads it, so scope which steps touch them.
  • External assets are not tied to the commit; pin a version so builds stay reproducible.

Related guides

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