Skip to content
tezvyn:

What is Git LFS and what are its CI/CD trade-offs?

MediumHow cards are made

This tests whether you understand Git's object model limits. A strong answer covers pointer indirection, smudge filters, and the shift of download burden to the LFS server in CI. A red flag is claiming LFS eliminates large file transfers entirely.

What's really being asked

This question evaluates whether you understand why Git's content-addressable object store performs poorly with large immutable binaries, and whether you can weigh operational fixes against architectural alternatives in automated build environments. Interviewers want to see that you distinguish between repository size problems and pipeline artifact management problems.

The full answer

A good answer hits four things in order. First, define Git LFS as an extension that replaces large files with small text pointers inside the repository while storing the actual binary content on a dedicated remote server. Second, explain the mechanics: clean filters upload binaries and write pointers on commit, while smudge filters read pointers and download binaries on checkout, which keeps the Git object graph small and clone times fast. Third, address the CI trade-offs: runners still pay the download cost, often on every ephemeral build, so you shift history bloat to bandwidth usage; you also introduce an external dependency and authentication step that can fail or rate-limit. Fourth, mention that for truly large or frequently changing binaries, an artifact store or model registry is often better than versioning binaries in Git at all.

The mistakes people make

Common wrong answers include recommending shallow clones or sparse checkouts as the primary solution without explaining pointer indirection, claiming that LFS eliminates large file downloads from CI, or ignoring the authentication and caching implications for ephemeral runners. Another red flag is suggesting gitignore without acknowledging that the requirement is to version the assets, or proposing to store binaries in Git if they are over a few hundred megabytes without discussing history growth.

What usually comes next

Interviewers may ask how you would cache LFS objects between CI runs, how to migrate an existing repository to LFS without breaking open pull requests, or how you would design a replacement using S3 and checksum files. They may also probe whether you would enforce LFS via hooks or server-side rules, and how you handle LFS billing or bandwidth quotas at scale.

A concrete example

Imagine a repository with a two-gigabyte machine learning model. In native Git, every version of that model is a permanent blob, so a fresh clone could pull dozens of gigabytes of unreachable history. With LFS, the repository stores only a hundred-byte pointer per version, but a CI runner performing a checkout must still download the two-gigabyte file from the LFS server unless it uses a persistent local cache. If the team runs twenty builds per day, that is forty gigabytes of daily LFS bandwidth per model version, which makes caching or switching to an artifact store with range requests an immediate operational concern.

Interview question

When using Git LFS for large binaries with ephemeral CI runners, what is the primary operational trade-off compared to native Git?

  • a.Shallow clones and sparse checkouts let runners avoid fetching LFS objects while still versioning the binaries.
  • b.Runners download full binaries from the LFS server on checkout, converting repository history bloat into per-build bandwidth and an external dependency.Correct
  • c.Git LFS stores binary deltas instead of full blobs, so runners only download changed portions of large files per build.
  • d.Runners skip downloading large files because the repository contains only small text pointers.
Why?

Git LFS replaces binaries with pointers to keep the repository small, but smudge filters still fetch the full files from the LFS server on checkout, shifting history bloat to per-build bandwidth and adding an external dependency. Option D is tempting because pointers suggest the binary is gone, yet ephemeral runners still pay the download cost on every checkout.

Just read this? Test yourself on what you have been reading.

Put your scrolling time to good use

Learn one idea, try a quiz and save useful cards for revision. Tezvyn makes it easy to learn and stay current in your tech field, a few minutes at a time.

The iPhone app is on the way

We are building it. Until it lands, nothing here is held back from you: every interview card, your saved cards, streaks and the job board all work in Safari, plus hundreds of free practice quizzes of thirty questions each. Sign in and it all carries over to the app the day it arrives.

Want it as an icon? Tap Share at the bottom of Safari, then Add to Home Screen. It opens full screen and the cards you have read stay available offline.

Get it on Google PlayiPhone app coming soon

We are hiring for this. Every open role lists the topics its interview covers, so you can prepare for the real thing rather than guessing.

See open roles