0

I have a couple of files that were added to various commits since I last pushed. They are too large and cannot be pushed. I used

git rm --cached <path to file>

and they don't show up when I check to see which files are being committed. When I attempt to push, however, I still get an error saying that these two files are too large and cannot be pushed.

How do I completely remove these files from all of my commits so that I can push the rest of my changes?

Jake Mulhern
  • 660
  • 5
  • 13
  • This [thread](https://stackoverflow.com/questions/2100907) has several good replies. But this [reply](https://stackoverflow.com/a/2158271/421195) is "better"(arguably "more instructive") than the accepted reply. Please review all the replies before doing anything. – paulsm4 Nov 22 '21 at 20:51
  • @paulsm4 I'd probably go with [filter-repo](https://stackoverflow.com/a/61602985/184546) over filter-branch. – TTT Nov 22 '21 at 21:35
  • 1
    Good call :) filter-repo is also one of the responses in the thread I cited: [100 times faster than git filter-branch and simpler](https://stackoverflow.com/a/61602985/421195). Note the warning: `Do this on a copy of your repository. Many actions of filter-repo cannot be undone` – paulsm4 Nov 22 '21 at 21:38
  • @paulsm4 Agreed. That warning is great advice. Fortunately, if you attempt to use `filter-repo` on anything other than a fresh clone, it won't work unless you provide the `-f` (force) option. – TTT Nov 22 '21 at 21:42
  • Thank you for the replies. I am currently attempting to use BFG to remove these files and will confirm a solution once I have seen that it works. – Jake Mulhern Nov 22 '21 at 22:05

0 Answers0