GitHub大文件超限求助:已删除文件但推送仍失败
GitHub大文件提交限制问题(未解决)
我在GitHub推送代码时遇到日志文件大小超限问题。已经修改.gitignore忽略可能变大的日志文件,切换到目标分支后用git rm删除了日志文件,还通过git amend重新提交,但问题依旧存在。
我用的是Windows 10系统,切换到所有分支的目录里都找不到shelf_tools_debug.log文件。推送时的错误信息如下:
> git push -u origin more_condensed remote: error: Trace: fdb1c7da70f9b5f5b67dde486e80c8c18d60c3b860dc79d4ca921f9607a1f402 remote: error: See http://git.io/iEPt8g for more information. remote: error: File shelf_tools_debug.log is 121.36 MB; this exceeds GitHub's file size limit of 100.00 MB remote: error: GH001: Large files detected. You may want to try Git Large File Storage - https://git-lfs.github.com. To https://github.com/MegMM/goodreads_group_shelf_tools.git ! [remote rejected] more_condensed -> more_condensed (pre-receive hook declined) error: failed to push some refs to 'https://github.com/MegMM/goodreads_group_shelf_tools.git'
我尝试过以下操作:
- A. 使用
git-sizer检测,得到精简后的输出:
... [4] 82e98731969aa0de9d38ba32bec6eac8fd8f361c (9135a1de462354b816a8e955dad7488e235ff879:shelf_tools_debug.log) [5] d1f05de111dd7db1ea4a99b49f7c9897a0146bff (refs/heads/more_condensed^{tree}) [6] fd5b1c436e247cbfa180f1817be0099b2569ba5f (9135a1de462354b816a8e955dad7488e235ff879^{tree})
- B. 尝试
git reset操作,出现以下错误:
> git reset --soft fdb1c7da70f9b5f5b67dde486e80c8c18d60c3b860dc79d4ca921f9607a1f402 fatal: ambiguous argument 'fdb1c7da70f9b5f5b67dde486e80c8c18d60c3b860dc79d4ca921f9607a1f402': unknown revision or path not in the working tree. > git reset --soft 9135a1de462354b816a8e955dad7488e235ff879 > Get-ChildItem -Recurse *.log > // 没有输出任何结果 > git reset --soft 82e98731969aa0de9d38ba32bec6eac8fd8f361c error: object 82e98731969aa0de9d38ba32bec6eac8fd8f361c is a blob, not a commit fatal: Could not parse object '82e98731969aa0de9d38ba32bec6eac8fd8f361c'. // 不清楚这是什么意思,也不知道该怎么处理
- C. 手动查看其他提交,未找到相关文件记录。
- D. 使用bfg工具清理:
> java -jar C:\Users\megha\Downloads\bfg-1.14.0.jar -b 100M .git Using repo : C:\MyProjects\gr_shelf_tools\.\.git Scanning packfile for large blobs: 1669 Scanning packfile for large blobs completed in 92 ms. Warning : no large blobs matching criteria found in packfiles - does the repo need to be packed?
我推测这个大文件的旧版本还留在提交历史里,但不知道下一步该怎么处理。
内容的提问来源于stack exchange,提问作者Meghan M.
相关产品推荐
相关产品推荐

