12

When trying to push, I get a fatal error because git is trying to include a file that is too large for GitHub. git rm file fails because the file doesn't exist (it has existed, but no longer does). Git seems to refuse to acknowledge that the file is gone.

What should I do?


For information, the error message I get is:

remote: error: GH001: Large files detected.
remote: error: Trace: dbbfb79f51f133c90dfd58730a4ab624
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File [filename] is 385.65 MB; this exceeds GitHub's file size limit of 100 MB
To https://github.com/[---].git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/[---].git'

If the above is as impossible to achieve as it seems, instructions on how to just torch all the git related stuff here and set it up from scratch with code that we have preserved in backup directories would be great. We really don't have time to mess around with git anymore...

gibson
  • 543
  • 1
  • 5
  • 15
  • possible duplicate of [Error while pushing to github repo](http://stackoverflow.com/questions/22227851/error-while-pushing-to-github-repo) – Andrew C Dec 17 '14 at 17:26
  • Yeah, it looks like the same issue. I lost patience with git and just started fresh. I wish there was a sane newbie introduction to git somewhere. Oh well. – gibson Dec 18 '14 at 13:16

1 Answers1

1

Run git rm --cached file even if the file does not exist anymore. This way, the file will be removed from the index.

If you are looking to completely eradicating the file from Git history, you will need some git filter-branch-fu instead.

Stefano Sanfilippo
  • 32,265
  • 7
  • 79
  • 80
  • 2
    ``git rm --cached file`` fails the same way as ``git rm file``. "fatal: pathspec file did not match any file". – gibson Dec 16 '14 at 16:20
  • 1
    Your problem appears to be slightly different. You have already removed the file with `git rm` but your history has grown too large, right? – Stefano Sanfilippo Dec 16 '14 at 16:24
  • I believe (but am not sure) that the file was removed by some other process (it was a temp file). The complaint I get when trying to push is that this specific file is too large to push to github. – gibson Dec 16 '14 at 16:26
  • Please post the exact error message in the body of the question. – Stefano Sanfilippo Dec 16 '14 at 16:27
  • Have you worked through all the proposed solutions in https://help.github.com/articles/working-with-large-files/ (shortlinked in the message above)? – Stefano Sanfilippo Dec 16 '14 at 18:21
  • I really only see one proposed solution, and it fails because ``git rm --cached filename`` fails. – gibson Dec 17 '14 at 07:23
  • I'm not sure how that works. Following the instructions on the page, I have created a new local clone, and run BFG on that. Pushing the old clone still fails (which seems natural). I don't want to lose the changes I've made since the last successful push, but I don't want to lose others' changes either. – gibson Dec 17 '14 at 12:19