0

I am trying to update a private repository on GitHub, however a large file is preventing me from doing so. GitHub warned me that the file was too large:

Delta compression using up to 2 threads.

Compressing objects: 100% (18/18), done.
Writing objects: 100% (22/22), 8.69 MiB | 3 KiB/s, done.
Total 22 (delta 11), reused 0 (delta 0)
remote: error: GH001: Large files detected.
remote: error: Trace: 0c940595507e24d7d2765083a99bdae8
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File logs/log.dat is 101.98 MB; this exceeds GitHub's file   size limit of 100 MB

I then cleared the files contents and re-committed. However, I'm still getting the same error. I've also tried the following to no avail:

git reset HEAD~1

and

git rm --cached logs/log.dat

Can anyone help?

Note: I have tried the solutions listed before posting this question. When they didn't seem to work I asked for help.

user2694306
  • 3,832
  • 10
  • 47
  • 95
  • Not a duplicate because their solution did not work. – user2694306 Apr 02 '15 at 13:28
  • possible duplicate of [How to remove/delete a large file from commit history in Git repository?](http://stackoverflow.com/questions/2100907/how-to-remove-delete-a-large-file-from-commit-history-in-git-repository) – user229044 Apr 02 '15 at 13:30
  • None of those solutions are working. That is why I posted a new question. Can we please try to be constructive and help other users rather than just closing valid questions. – user2694306 Apr 02 '15 at 13:34
  • In this case probably the situation (and the title) is a bit misleading. If the commit has been reverted already (It isn't visible in the history), probably there is only some (big) traces in the .git folder, which should be removed with the proper .git commands. (But I am not really sure whether the related commit is really reverted, because in that case I don't think git would try to upload it to github.) – Lajos Veres Apr 02 '15 at 13:53

1 Answers1

0

First of all, prune the things that are no longer connected:

git prune

If that doesn't help, maybe your commit is still being there packed;

git prune-packed

EDIT if that still doesn't work, it means that there is still the commit in your repo's history that added the original file (otherwise, a working git rm --cached after your git reset doesn't make sense).

You could commit after doing git rm, then git rebase -i HEAD~10, moving the line of your rm-commit right after the one of the commit that originally added the file. apply that rebase. Then again (I always do this in two steps, just to keep the confusion at a tolerable level) git rebase -i HEAD~10, this time changing your rm-commits type from pick to fixup. That should take the added file out of the adding commit.

Marcus Müller
  • 34,677
  • 4
  • 53
  • 94