Deleted Large File But Still Cannot Push To Github Because Non-existent File Exceeds Github Limit — Quick Fix

Kevin K
2 min readMay 15, 2021

Today I accidentally added a very large video to my TaBoard WebApp landing page which was actually supposed to be a GIF (file size difference of about 100mb) and upon trying to push to github I repeatedly got the error that my file size exceeds the limit of 100mb.

I found these standard solutions for large files:

However I didn’t actually want this video in my app anyway, so I deleted it, added the GIF version and pushed again, no biggy. But wait… Github complained again that my now non-existent file is too large. This is because your file is still living on in the ether of your previous git history. Basically Git is doing it’s job… a little too well. This problem has been thoroughly discussed on many threads and most solutions are something like this.

Screenshot from Stack Overflow

I personally don’t love writing things in my terminal that I don’t really understand so I kept looking and stumbled upon a much easier solution. In the end I found this solution on the github community site.

Screenshot of Github Community Site

Solution: In the end I just used a more basic version of the fix described above. Simply restore the file with git restore <file>in terminal. Then git checkout master and open a new branch, make the changes you made before and voila, now you can push to Github.

--

--

Kevin K

I write about my web dev and UX design exploits. I work full time at www.fj-tech.io