Git LFS: Understand Pointers and External Content
Why large assets need a different strategy
Imagine a garden project with frequently revised photographs. Ordinary Git records each version as a blob; deleting a photograph in a later commit does not remove older versions. Git Large File Storage (LFS) is an optional extension that puts compact pointers in Git and manages payloads in a separate object store. It does not make the original bytes disappear or remove storage costs.
Read a pointer, not the image
A nonempty ordinary LFS v1 pointer has a specification identifier, an oid containing the SHA-256 digest of the payload bytes, and the payload size in bytes. The Git blob ID of the pointer is a different identifier. Neither identifier is a URL granting access. In the fixture, asset.pointer is an ordinary text blob made by Python, not a real LFS-managed path.
git show HEAD:asset.pointergit cat-file -s HEAD:asset.pointerThe real workflow and its boundaries
In an authorized repository with Git LFS installed, git lfs install --local sets up repository integration; git lfs track "*.bin" records a path rule in .gitattributes. Review and commit that file with the intended assets. The clean filter creates a pointer; checkout can retrieve and materialize payload bytes through LFS. A missing object, quota or authorization failure can prevent retrieval. Check host limits and budget before adoption. Tracking a pattern does not rewrite older history; any migration of published history needs coordinated planning and backups. These LFS commands are documentation-only in this batch.
Practice and check
Run the supplied chapter26 laboratory. Compare the pointer size with the mock payload size and inspect the SHA-256 check; a changed byte sequence fails that digest comparison. Predict what happens if only the pointer is backed up: the pointer remains readable, but reconstruction is impossible unless the actual payload is available elsewhere. The mock does not test LFS filters, authentication or transfer.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Git LFS: Understand Pointers and External Content — knowledge check
Distinguish storage, history, working tree and maintenance costs.
What does a typical nonempty LFS pointer contain?
If only the pointer survives, can it reconstruct the original file?
Does tracking a new LFS pattern convert previous commits automatically?
What is the LFS oid digest computed from?
What did this chapter actually verify?