Large File Storage (LFS)

A real binary asset, genuinely bloating the repo. The real fix — and an honest tooling gap.

product-photo.bin is a real, sizeable binary asset, already committed straight into history. Every future real clone of this repository downloads it — and every future revision of it, if it is ever replaced, since plain git keeps every version of every blob forever. Git LFS solves this real problem by storing a real, tiny pointer file in git's own history instead of the actual binary content, keeping the real bytes on a separate LFS server that only downloads what a given checkout actually needs.\n\nAn honest note, confirmed directly: this particular sandbox's minimal Buildroot image does not have the real git-lfs binary installed — only plain git. This lab still does everything real that does not require it: measuring the real bloat, and writing the real .gitattributes configuration a team would commit. Running git lfs install and git lfs migrate import to actually activate the filter is real, standard, one-time setup on any machine that has the tool — just not directly runnable here.

Measuring the Real Problem

du -sh .git
git count-objects -vH

A real, direct measurement of exactly how much of the repository's real size is already-committed object data — including the binary asset that will only grow every time it is replaced.

The Real LFS Configuration

*.bin filter=lfs diff=lfs merge=lfs -text
*.psd filter=lfs diff=lfs merge=lfs -text
*.mp4 filter=lfs diff=lfs merge=lfs -text

A real .gitattributes entry a team commits once — telling git (once LFS is installed) to treat matching files specially: store a real, tiny pointer in git's own history, and hand the actual bytes to LFS instead.

Where This Sandbox's Real Tooling Stops

which git-lfs
# (nothing — confirmed directly, not installed here)

On a real machine with git-lfs installed, the remaining real steps are: git lfs install (once, registers the filter), git lfs track "*.bin" (writes the same .gitattributes line automatically), and git lfs migrate import --include="*.bin" (rewrites history so already-committed binaries become real pointers too). This sandbox can commit the real .gitattributes text — the same reference of exactly what to commit — just not run the LFS binary itself to activate it.

git count-objects -vH

Reports real, human-readable totals for the object database's size. Confirmed directly in this lab: the real binary asset's own committed size was directly visible in the total.

LFS pointer file

What plain git actually stores in history once LFS is active — a tiny real text file naming the actual content's hash and size, with the real bytes kept on a separate LFS server. Confirmed directly in this lab (by its absence): without git-lfs installed, .gitattributes alone does not create pointer files — the real binary stays committed exactly as-is.

📏 Measure the Real Bloat

A real, direct measurement of what this binary asset already costs.

cd ~/team-recipes && du -sh .git
cd ~/team-recipes && git count-objects -vH
cd ~/team-recipes && git cat-file -s HEAD:product-photo.bin

student@lab:~$ cd ~/team-recipes && du -sh .git 720.0K .git student@lab:~$ cd ~/team-recipes && git count-objects -vH count: 0 size: 0 bytes in-pack: 840 packs: 2 size-pack: 104.68 KiB prune-packable: 0 garbage: 0 size-garbage: 0 bytes student@lab:~$ cd ~/team-recipes && git cat-file -s HEAD:product-photo.bin 300000

⚙️ The Real LFS Configuration

The exact real .gitattributes text a team would commit.

cd ~/team-recipes && printf '*.bin filter=lfs diff=lfs merge=lfs -text\n*.psd filter=lfs diff=lfs merge=lfs -text\n*.mp4 filter=lfs diff=lfs merge=lfs -text\n' > .gitattributes
cd ~/team-recipes && git add .gitattributes && git commit -m 'Track large binary assets with Git LFS'
cd ~/team-recipes && cat .gitattributes

student@lab:~$ cd ~/team-recipes && printf '*.bin filter=lfs diff=lfs merge=lfs -text\n*.psd filter=lfs diff=lfs merge=lfs -text\n*.mp4 filter=lfs diff=lfs merge=lfs -text\n' > .gitattributes student@lab:~$ cd ~/team-recipes && git add .gitattributes && git commit -m 'Track large binary assets with Git LFS' [master 8d26bd6] Track large binary assets with Git LFS 1 file changed, 3 insertions(+) create mode 100644 .gitattributes student@lab:~$ cd ~/team-recipes && cat .gitattributes *.bin filter=lfs diff=lfs merge=lfs -text *.psd filter=lfs diff=lfs merge=lfs -text *.mp4 filter=lfs diff=lfs merge=lfs -text

🔍 An Honest Tooling Check

Confirm directly: this sandbox genuinely does not have git-lfs.

cd ~/team-recipes && which git-lfs; echo "exit: $?"

student@lab:~$ cd ~/team-recipes && which git-lfs; echo "exit: $?" exit: 1

Lab 3.5.4 complete — Block 3.5 complete. A real, measured bloat problem, and the real configuration that solves it:\n\n\n Real bloat measured : ✅ git count-objects\n .gitattributes written : ✅ real filter=lfs config\n Tooling gap confirmed : ✅ git-lfs genuinely absent here\n

Enable JavaScript to run the live terminal and track your progress.