Skip to content

Large File Rejected

Error message

                remote: error: File <name> is <size> MB; this exceeds GitHub's file size limit of 100 MB
              

Quick summary

The file you are pushing is too large for the remote (GitHub limits files to 100 MB). You need Git LFS or to remove the file.

Why this happens

  • A binary file (video, database, archive) exceeds 100 MB

  • A build artifact or data file was accidentally committed

  • Dependencies or compiled output was not gitignored

Minimal example

✗ Broken code
git add large-video.mp4
git commit -m "Add video"
git push  # error: file exceeds 100 MB limit
✓ Fixed code
# Remove the file from the commit
git rm --cached large-video.mp4
echo "*.mp4" >> .gitignore
git add .gitignore
git commit --amend -m "Ignore large videos"
git push  # succeeds

# Or use Git LFS:
git lfs install
git lfs track "*.mp4"
git add .gitattributes
git add large-video.mp4
git commit -m "Add video via LFS"

Remove the large file from history and add it to .gitignore, or use Git LFS to track large files properly.

How to diagnose

  • Identify the large file from the error message

  • Check if the file is tracked: git ls-files | grep <filename>

  • Determine if the file should be in the repo at all

How to fix

  • Remove the file from history: git filter-branch or git filter-repo --path <file> --invert-paths

  • Add the file to .gitignore to prevent future commits

  • Use Git LFS for large files that must be tracked: git lfs track '<pattern>'

  • If the file is not needed, delete it and commit the removal

How to prevent

  • Add large file patterns to .gitignore (e.g. *.mp4, *.zip, *.db)

  • Use Git LFS for large binary assets that must be version-controlled

  • Check file sizes before committing

Related Resources

Related Glossary

Related Lessons

← Back to language