1

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.        
Patrick
  • 5,526
  • 14
  • 64
  • 101
  • https://docs.github.com/en/repositories/working-with-files/managing-large-files/about-large-files-on-github#removing-files-from-a-repositorys-history describes how to handle this issue. You need to remove it from commits – Jan Myszkier Jan 12 '22 at 08:30
  • 2
    Does this answer your question? [After upgrading from Angular 12 to 13, cache is too large for Github](https://stackoverflow.com/questions/70088051/after-upgrading-from-angular-12-to-13-cache-is-too-large-for-github) – Jan Myszkier Jan 12 '22 at 08:31

1 Answers1

3

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)
VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
  • Appreciate the assist, do I really need to install Python libs to fix this though? I don't have any issue with that but you'd think I could resolve this without needing to bring in yet another language. – Patrick Jan 12 '22 at 09:11
  • 1
    @Patrick I agree, this is what I don't appreciate with `git filter-repo`. However, that tool is so much versatile, precise and faster than other alternatives it is worth the additional language installation. – VonC Jan 12 '22 at 09:13
  • I have 6 pending commits I need to push, is there any way I can determine which one of these is holding what it thinks is a 100+ MB file and get rid of it? I am not a master of the git command line. – Patrick Jan 12 '22 at 09:19
  • @Patrick Yes: https://github.com/github/git-sizer – VonC Jan 12 '22 at 09:30