-3

I am trying to push a local repo to my private GitHub and got an error saying the file size exceeded 100MB. That I understand. I actually don't need that file, so I deleted if from my repository (actually deleted it from my computer).

When I went to push the repository again (without that large file since it had been deleted) I get the same error for that file that was deleted from my computer. I even added it to my gitignore file.

Not sure why that file is still causing an issues as it has been deleted from my computer.

random
  • 9,774
  • 10
  • 66
  • 83
user2184718
  • 675
  • 1
  • 12
  • 30

1 Answers1

5

Since you have committed your large file, it is currently in git history, and deleting it will not help - git keeps it should you ever want to rewind back to that commit.

What you need to do is to rewrite history. Easiest way to kill last commit is:

git reset --hard HEAD~

If this was not last commit, you may need to kill more, or use git filter-branch. You can find more about rewriting history in git documentation.

mvp
  • 111,019
  • 13
  • 122
  • 148