git push_error ai_generated true

remote: error: File X is 100.00 MB; this exceeds GitHub's file size limit of 100.00 MB

ID: git/large-file-push-rejected

Also available as: JSON · Markdown
85%Fix Rate
88%Confidence
50Evidence
2023-01-01First Seen

Version Compatibility

VersionStatusIntroducedDeprecatedNotes
2 active

Root Cause

File exceeds GitHub's 100MB limit. Can't push even after removing — it's in git history.

generic

Workarounds

  1. 90% success Use git filter-branch or BFG Repo Cleaner to remove from history
    git filter-branch --tree-filter 'rm -f large-file.bin' HEAD
    # or: bfg --strip-blobs-bigger-than 100M

    Sources: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/removing-sensitive-data-from-a-repository

  2. 88% success Use Git LFS for large files going forward: git lfs track '*.bin'
    git lfs install
    git lfs track '*.bin'
    git add .gitattributes

    Sources: https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-git-large-file-storage

  3. 85% success Add large files to .gitignore before committing
    # Add patterns to .gitignore BEFORE committing:
    echo '*.zip' >> .gitignore
    echo '*.tar.gz' >> .gitignore
    echo 'data/*.csv' >> .gitignore
    
    # If already committed, remove from tracking:
    git rm --cached large-file.zip
    git commit -m 'Remove large file from tracking'

    Sources: https://git-scm.com/docs/gitignore

Dead Ends

Common approaches that don't work:

  1. Just delete the large file and push again 90% fail

    File is still in git history — push will still fail

  2. Increase the file size limit 95% fail

    GitHub's limit is fixed at 100MB — can't be changed

Error Chain

Frequently confused with: