How to fix git error 'this exceeds GitHub's file size limit of 100.00 MB' or 'this is larger than GitHub's recommended maximum file size of 50.00 MB'

26 December 2022

I will not explain the all detail why and how because I just do not know. I just post what fixed this on my case:

You have first to remove those files from your repo. Then remove them from the history by using git-filter-repo. Download the, put it your path and use it like git filter-repo or as standalone with python3

For this you can first analyze your repos and check things out.

python3 --analyze

It will write some files in .git\filter-repo\analysis and you can easily find problematic files in here:

In my case I find those file again in path-deleted-sizes.txt

=== Deleted paths by reverse accumulated size ===
Format: unpacked size, packed size, date deleted, path name(s)
   107151516  106712325 2022-12-22 files/Batch/FFmpeg/202212212131_ScreenCapture.mp4
    92785522   92413548 2022-12-22 files/Batch/FFmpeg/202212212235_ScreenCapture.mp4
    72096675   27407725 2022-11-18 files/srtm_37_04.tif
    12877654   12780899 2022-12-22 files/Batch/FFmpeg/202212212220_ScreenCapture.mp4

You need the correct fullpath of those files to run:

python3 C:\Users\doria\Downloads\ --path files/srtm_37_04.tif --invert-paths

You may need to force it with --force.

You will see that it is working with the files number decreasing. And finally push.

git push --set-upstream origin master --force

If you have a creditential error, you may have to run:

git remote add origin

Other usefull cmd to see the history :)

git log --graph --decorate --pretty=oneline --abbrev-commit --all --name-status


    Join the discussion for this article on this ticket. Comments appear on this page instantly.
    Thanks to aristaht for making this static comment system possible.