0

In my project, I had one file which is over 100 MB (which means I am unable to upload it to Github). I committed my changes, including the addition of the file. I then realized that the file was unneeded, and I removed it. However, when I committed again, I was still unable to push my commits because of that one file which was removed being over the 100 MB limit, even though I removed it in the subsequent commit. Is there a way to merge these two commits so that the file never existed so that it doesn't try to push it to Github?

I know I can use something like git-lfs, but I was just curious to see if there was a faster way to fix this kind of problem.

willbill
  • 80
  • 1
  • 9

1 Answers1

1

You can use git rebase -i starting from a commit which doesn't have the 100MB file, and edit the commits that wrongly add this file in your history.

LeGEC
  • 46,477
  • 5
  • 57
  • 104