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

Git LFS

git Intermediate

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 30
Rate this term
No ratings yet
🤖 AI Guestbook educational data only
| |
Last 30 days
0 pings W 0 pings T 0 pings F 2 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 0 pings M 0 pings T 0 pings W 1 ping T 0 pings F 4 pings S 0 pings S 0 pings M 0 pings T 1 ping W 0 pings T 0 pings F 2 pings S 0 pings S 0 pings M 0 pings T 0 pings W 0 pings T
No pings yet today
No pings yesterday
Amazonbot 13 Perplexity 9 Ahrefs 2 Google 2 Majestic 1 ChatGPT 1
crawler 27 crawler_json 1
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