2

I am getting this error

remote: error: File _____ is 262.63 MB; this exceeds GitHub's file size limit of 100.00 MB

so I added the file to .gitignore.

However it's still trying to add it. Is there something I need to do in order for it to work?

halfer
  • 19,824
  • 17
  • 99
  • 186
SuperString
  • 21,593
  • 37
  • 91
  • 122
  • Which command are you executing? And what is the output of `git status`? It seems that you already staged it, so you first have to unstage it. To the best of my knowledge .gitignore does not have an effect on files that are already tracked. – Bernhard Aug 09 '18 at 10:08
  • Possible duplicate of [How to make Git "forget" about a file that was tracked but is now in .gitignore?](https://stackoverflow.com/questions/1274057/how-to-make-git-forget-about-a-file-that-was-tracked-but-is-now-in-gitignore) – phd Aug 09 '18 at 10:23
  • https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository – phd Aug 09 '18 at 10:24
  • Possible duplicate of [How to remove/delete a large file from commit history in Git repository?](https://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository) – Jan Hudec Aug 09 '18 at 10:32
  • The first duplicate is insufficient, because it does not deal with the file being already committed. The second is a duplicate though. – Jan Hudec Aug 09 '18 at 10:33

1 Answers1

6

It's probably still added to your git repo, so you need to remove it with the following commands:

git rm --cached path/to/giant_file
# Stage your giant file for removal from the git repo

Commit this change with --amend

git commit --amend -CHEAD
# Amend the previous commit with your change

And finally, you can push as usual!

git push
# Push your smaller commit
Gladen
  • 792
  • 2
  • 8
  • 17