尝试push
时,我收到一个 fatal error ,因为git 试图包含一个对于GitHub 来说太大的文件。 git rm file
失败,因为该文件不存在(它已经存在,但不再存在)。 Git 似乎拒绝承认文件已经消失。
我该怎么办?
有关信息,我收到的错误消息是:
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'
如果上面的目标看起来是不可能实现的,那么关于如何在此处删除所有与 git 相关的东西并使用我们保存在备份目录中的代码从头开始设置它的说明会很棒。我们真的没有时间再和 git 纠缠了......
最佳答案
运行 git rm --cached file
即使该文件不再存在。这样,该文件将从索引中删除。
如果您希望从 Git 历史中彻底删除该文件,您将需要一些 git filter-branch
-fu。
关于git - 如何阻止 Git 尝试推送不存在的文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27508930/