GitHub - Large Files Detected - Can't Push

I am completely unable to push to my GitHub master branch. It is complaining about a 100+ MB file that isn't even part of the front-end, this file is part of a .Net backend. The front-end is Angular 13. These are separate projects.

What can I do here? I've exhausted all options.

It's complaining about an Angular webpack cache file ("4.pack"). I've added this to .gitignore and have done what I can from the Git side without luck.

remote: error: File .angular/cache/angular-webpack/9a0d55421134d22ded528bf53077d11bd7793d98/4.pack is 126.57 MB; this exceeds GitHub's file size limit of 100.00 MB        
remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com.        

Solution 1:

In addition of ignoring .angular/cache, you can consider using git filter-repo instead of the obsolete git filter-branch or BFG.

That way, you would:

  • install git filter-repo (python-based)
  • delete any large file in your history: git filter-repo --strip-blobs-bigger-than 2M for instance. (content-based filtering)
  • ignore .angular/cache
  • force push (git push --force: make sure to notify any collaborator on that repository)