← Home ← Codex ← DEBT
Browse by Category
+ added · updated 7d
← Back to glossary

Git LFS

Git Intermediate
debt(d7/e7/b7/t7)
d7 Detectability Operational debt — how invisible misuse is to your safety net

Closest to 'only careful code review or runtime testing' (d7). The detection_hints note automated=no and tools like git-lfs and github-bfg require manual invocation. The problem — large binaries silently accumulating in git history — is not caught by default linters or compilers; it only becomes visible when clones become slow or repo size balloons in production, often after significant damage is done. A specialist can run `git lfs ls-files` or check repo size, but nothing flags the problem automatically at commit time without pre-commit hooks explicitly configured.

e7 Effort Remediation debt — work required to fix once spotted

Closest to 'cross-cutting refactor across the codebase' (e7). The quick_fix notes LFS for new files, but common_mistakes explicitly state 'installing LFS after large files are already committed — past commits unchanged.' Remediation requires rewriting git history (BFG Repo Cleaner or git-filter-repo), coordinating all contributors to re-clone, updating CI/CD pipelines, and reconfiguring .gitattributes — a cross-cutting effort affecting the entire team's workflow and repository history.

b7 Burden Structural debt — long-term weight of choosing wrong

Closest to 'strong gravitational pull' (b7). Once large binaries are committed to git history (or LFS is adopted), every contributor, CI system, and deployment pipeline is shaped by the choice. Applies_to is 'any' context. The repository size and clone time affect every future developer; LFS requires every contributor to have git-lfs installed and configured; bandwidth quotas must be planned for. The choice defines how the entire team interacts with assets going forward.

t7 Trap Cognitive debt — how counter-intuitive correct behaviour is

Closest to 'serious trap' (t7). The misconception field directly states the canonical trap: developers believe deleted binary files are gone from history, but every version is stored permanently and affects every clone. This contradicts how most version control systems appear to work (delete = gone) and how text files behave (delta-compressed). Additionally, installing LFS after the fact doesn't fix past commits — the 'obvious' remediation is incomplete. These are well-documented gotchas that contradict reasonable developer assumptions.

About DEBT scoring →

Also Known As

git LFS large file storage binary files git

TL;DR

Replaces large binary files with text pointers in git — keeping repository fast while storing actual binaries on a separate LFS server.

Explanation

Git LFS stores large files (images, videos, audio, design files, compiled binaries, datasets) outside the git object store. In the repository: a 134-byte text pointer file. On the LFS server: the actual binary content. Benefits: fast clone (no large binaries by default), full history accessible, file locking for exclusive edits. Commands: git lfs install, git lfs track '*.psd', commit .gitattributes. Providers: GitHub (1GB free), GitLab, Bitbucket all support LFS. Past commits with large files are unchanged — LFS only affects future commits.

Common Misconception

Git handles large binary files fine — every binary version is stored permanently in git history; a 100MB video committed and deleted is still 100MB in the repository forever, affecting every clone.

Why It Matters

A design team committing Figma exports, PSDs, and videos directly to git creates a repository that takes 30 minutes to clone — git LFS keeps the same workflow with fast clones.

Common Mistakes

  • Installing LFS after large files are already committed — past commits unchanged
  • Not committing .gitattributes — LFS tracking rules lost for other contributors
  • LFS without bandwidth budget planning — LFS downloads count against provider quotas
  • Tracking too many file types — small icons are fine in regular git

Code Examples

✗ Vulnerable
# Large files in regular git:
git add design-mockups/hero-video.mp4  # 250MB
git add design-mockups/assets.psd       # 180MB
git commit -m 'Add design assets'
# Every clone now downloads 430MB for these files alone
✓ Fixed
# Git LFS setup:
git lfs install
git lfs track '*.mp4' '*.psd' '*.ai' '*.sketch'
git add .gitattributes
git add design-mockups/hero-video.mp4  # LFS pointer: 134 bytes
git commit -m 'Add design assets (via LFS)'
# Clone: fast — pointer files only
# git lfs pull: downloads actual binaries when needed

Tags


Added 16 Mar 2026
Edited 22 Mar 2026
Views 55
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings T 0 pings W 1 ping T 0 pings F 0 pings S 0 pings S 0 pings M 1 ping T 1 ping W 2 pings T 0 pings F 0 pings S 1 ping S 2 pings M 0 pings T 1 ping W 0 pings T 0 pings F 0 pings S 0 pings S 1 ping M 0 pings T 0 pings W 0 pings T 0 pings F 1 ping S 1 ping S 1 ping M 0 pings T 0 pings W
No pings yet today
No pings yesterday
Amazonbot 17 Perplexity 9 Scrapy 7 Ahrefs 4 Google 4 ChatGPT 4 Claude 2 PetalBot 2 Majestic 1 Meta AI 1
crawler 47 crawler_json 4
DEV INTEL Tools & Severity
🟡 Medium ⚙ Fix effort: Medium
⚡ Quick Fix
Use Git LFS for binary files (assets, PDFs, videos) over 1MB — large binaries in git slow every clone, bloat the repo, and can't be delta-compressed; LFS stores pointers in git and blobs in separate storage
📦 Applies To
git any
🔗 Prerequisites
🔍 Detection Hints
Binary files committed to git repo; clone taking minutes due to binary history; repository size >1GB; PDF or video files in version control
Auto-detectable: ✗ No git-lfs github-bfg
⚠ Related Problems
🤖 AI Agent
Confidence: Medium False Positives: Medium ✗ Manual fix Fix: Medium Context: File


✓ schema.org compliant