gpt4 book ai didi

github - 通过 Git 推送大文件的问题

转载 作者:行者123 更新时间:2023-12-03 08:46:52 25 4
gpt4 key购买 nike

目前,当我尝试推送到 Git 存储库时,出现以下错误。

remote: error: GH001: Large files detected.
remote: error: Trace: 7bbfe5c1099cfe679aa3cd1eee13e10a
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File e3384023be667de7529538b11c12ec68.201307290946.sql.gz is 125.37 MB; this exceeds GitHub's file size limit of 100 MB
我已经检查并确保目录中不存在此文件,并已完成 git add -u .我们试图修剪分支,但这不起作用,因为它找不到要删除的文件。

最佳答案

您可能正在推送多个提交,其中一个包含一个大文件,另一个是最近的一个删除该文件。

在任何情况下,您都可以尝试,如“Fixing the “this exceeds GitHub’s file size limit of 100 MB” error”中所述,过滤分支(如果您知道看不到的大文件的名称/路径)

git filter-branch --index-filter 'git rm --cached --ignore-unmatch e3384023be667de7529538b11c12ec68.201307290946.sql.gz' <sha1>..HEAD

或者,如果您不知道但想删除任何大文件(比如 > 90MB),您可以使用 BFG repo cleaner
bfg --strip-blobs-bigger-than 90M  my-repo.git

这将在您的 repo 历史记录中为您跟踪那个难以捉摸的大文件并将其删除。
请注意,您必须执行 git push --force在那之后,因为最近提交的历史将被修改。
如果其他人之前已经克隆了您的 repo,请进行一些沟通以警告他们。

关于github - 通过 Git 推送大文件的问题,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/19858590/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com