Git LFS
In one line
Git LFS (Large File Storage) replaces large files in the repo with text pointers, storing the actual content on a separate server.
In simple words
Git LFS (Large File Storage) is an extension that lets Git handle large files — videos, datasets, graphics, binaries — efficiently. Instead of storing the full file in the Git object store (which would bloat the repo and slow every clone), LFS stores a small pointer file in Git and the real content on a separate LFS server.
When you clone, LFS downloads the pointer files with the repo and then fetches the actual large files on demand (or all at once with git lfs pull). This keeps the repo small and fast for text operations while still versioning large files. The .gitattributes file marks which paths use LFS.
LFS requires server-side support (GitHub, GitLab, and Bitbucket all offer it, with quotas). Without the LFS extension installed, a clone gets only the pointers. Use LFS for files over a few megabytes that change occasionally — not for frequently-changing large files, where the LFS storage grows quickly.
Example
# Install Git LFS (once per machine)
git lfs install
# Track large file types — updates .gitattributes
git lfs track "*.psd"
git lfs track "*.mp4"
git lfs track "data/*.csv"
# Commit the .gitattributes, then add large files normally
git add .gitattributes
git add design.psd
git commit -m "add design file"
# Clone pulls pointers; fetch real content
git lfs pullgit lfs track marks patterns to store via LFS. The real content goes to the LFS server; Git stores a pointer. lfs pull downloads the actual files.
Related terms
Related Resources
Related Lessons
- Git Advanced
Learn Git LFS.
Decode error messages
Plain-English explanations of common errors — what they mean, why they happen, and how to fix them.