← Back to all fixes
Git

Push rejected: file too large

The Issue

`git push` fails: `remote: error: File data/model.bin is 210.00 MB; exceeds GitHub maximum file size of 100.00 MB`

Root Cause

A large binary or data file was committed to the repo. GitHub/GitLab reject files over 100MB.

How to Fix
  1. Remove the file from the last commit without losing your other changes: `git rm --cached data/model.bin && git commit --amend`
  2. If the file is in multiple commits: use `git filter-repo --path data/model.bin --invert-paths`
  3. Add the file type to .gitignore to prevent future accidents
  4. For large files you need to version: use Git LFS (`git lfs track "*.bin"`)
  5. For datasets and models: use cloud storage (S3) and reference by URL instead of committing