Git lfs - this exceeds GitHub's file size limit of 100.00 MB
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.
Introduction
When GitHub says a file exceeds the 100 MB file size limit, the immediate problem is not Git LFS itself. The problem is that the large binary was committed into normal Git history instead of being stored as a Git LFS object. GitHub rejects that push before it ever becomes a healthy LFS workflow.
The fix depends on timing. If the large file is only in your working tree, track it with Git LFS before committing. If the oversized blob is already in commit history, you need to rewrite that history so Git stores an LFS pointer instead of the raw file contents.
What Git LFS Actually Does
Git LFS replaces large files in Git history with small pointer files. The real file contents are stored in the LFS store, while the repository keeps lightweight references.
A typical setup looks like this:
That works only if the large file is being committed after LFS tracking is in place.
If the Large File Is Already Committed
A common mistake is to add Git LFS after the oversized file is already part of history. GitHub will still reject the push because the old commit contains the full blob.
In that case, migrate the file into LFS history:
Or for a pattern:
This rewrites commits so the large blobs become LFS pointers. After that, you usually need to force-push the rewritten history.
Verify That LFS Is Tracking the File
Before pushing, inspect the tracked patterns and the file state:
If the file does not appear in git lfs ls-files, Git still sees it as a normal file, not an LFS-managed one.
This is the step many people skip. They assume that installing Git LFS alone retroactively fixes history, but it does not.
Understand the Tradeoffs of Rewriting History
History rewriting is safe only if you coordinate with anyone else using the branch. Once commits change, other clones will need to rebase, reset, or reclone.
That is why the right operational sequence is:
- stop pushing more commits with the large file
- migrate or rewrite the history
- verify LFS tracking locally
- force-push the corrected branch if necessary
- tell collaborators what changed
Large-file cleanup is a history-management problem as much as a storage problem.
Common Pitfalls
- Installing Git LFS after the large file is already in commit history and assuming that is enough.
- Tracking the file pattern in
.gitattributesbut forgetting to recommit or migrate the existing file. - Force-pushing rewritten history without coordinating with collaborators.
- Using Git LFS for files that should not live in Git at all, such as generated build artifacts.
- Skipping verification with
git lfs ls-filesbefore pushing.
Summary
- GitHub rejects normal Git blobs larger than 100 MB.
- Git LFS solves the problem only if the file is tracked as an LFS object, not a normal blob.
- If the large file is already committed, rewrite history with
git lfs migrate importor an equivalent cleanup step. - Verify the result before pushing.
- Treat the fix as both an LFS configuration task and a history-repair task.
Related reading
- GIT list of new/modified/deleted files
- Git list only untracked files also, custom commands
- git log --follow, the gitpython way
- Git log to get commits only for a specific branch
- git log to return only the commits made to the master branch?
- Git merge branch into master
- Git merge errors
- Git merge from someone else's fork
.png&w=3840&q=75)
Tackling System Design Interview Problems
A short course that equips you with the skills to approach system design interviews methodically.
Start the free courseNo course covers this one yet
Basis Lab writes one for you from a sentence about what you want to be able to do, then teaches it and checks you understood. Your first course is free.
Build my courseTrack what you have practised
A free account saves your progress, solutions and study plan across every problem on Codemia.
Interview Questions practice on Codemia
Over 8,000 real interview questions from top companies, searchable by company and role.