Github-文件XYZ为126.80 MB;这超出了GitHub的文件大小限制100.00 MB [英] Github - File XYZ is 126.80 MB; this exceeds GitHub's file size limit of 100.00 MB

查看:83
本文介绍了Github-文件XYZ为126.80 MB;这超出了GitHub的文件大小限制100.00 MB的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个本地存储库,不小心将一个大文件添加到其中.现在,即时通讯几乎落后了100次提交.当我尝试推送到GitHub时,它给了我一个错误.

I have a local repository that a large file was accidentally added to. Now im almost 100 commits behind. When I try to push to GitHub it gives me an error.

我需要做任何我需要做的事情,以便能够推送此存储库的其余部分.

I need help doing whatever I need to do to be able to push the rest of this repository.

我不需要此文件,可以将其永久删除

(侧面说明:这是一个包含IPython节点和代码的目录.我有一个脚本自动推送它,这就是为什么我落后了将近100次提交.我只是注意到它没有被同步)

这是我没有成功尝试过的事情:

(Side Note: This is a directory with IPython nodes & code. I have a script auto pushing it which is why I'm almost 100 commits behind. I just noticed that it wasn't sync'd)

git status

在分支母版上您的分支比起源/主"要先进100次提交.
(使用"git push"发布您的本地提交)
没有要提交的内容,工作目录很干净

On branch master Your branch is ahead of 'origin/master' by 100 commits.
(use "git push" to publish your local commits)
nothing to commit, working directory clean

git filter-branch --index-filter 'git rm --cached --ignore-unmatch "Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt"' --tag-name-filter cat -- --all

重写d381c7d5037a6a26abb2b5cef06e57d8b86a398b(95/189)rm'教育/课程/探索性数据分析/周1/household_power_consumption.txt'
..
重写f639b57714a5d57ff37b9d4a55c1c69fc0b514a8(176/189)rm'教育/课程/探索性数据分析/周1/household_power_consumption.txt'
重写587c8b65f19315ebeb6627a75bd703a5dbdec208(189/189)

Rewrite d381c7d5037a6a26abb2b5cef06e57d8b86a398b (95/189)rm 'Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt'
..
Rewrite f639b57714a5d57ff37b9d4a55c1c69fc0b514a8 (176/189)rm 'Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt'
Rewrite 587c8b65f19315ebeb6627a75bd703a5dbdec208 (189/189)

Ref'refs/heads/master'被重写
警告:Ref'refs/remotes/origin/master'不变

Ref 'refs/heads/master' was rewritten
WARNING: Ref 'refs/remotes/origin/master' is unchanged

git rm "Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt"

致命的:pathspec'Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt'与任何文件都不匹配

fatal: pathspec 'Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt' did not match any files

git push

警告:push.default未设置;它的隐式值在Git 2.0中从匹配"更改为简单".要抑制此消息并在默认更改后保持当前行为,请使用:

warning: push.default is unset; its implicit value is changing in Git 2.0 from 'matching' to 'simple'. To squelch this message and maintain the current behavior after the default changes, use:

git config --global push.default匹配

要抑制此消息并立即采用新行为,请使用:

To squelch this message and adopt the new behavior now, use:

git config --global push.default简单

当push.default设置为"matching"时,git会将本地分支推送到已经存在相同名称的远程分支.

When push.default is set to 'matching', git will push local branches to the remote branches that already exist with the same name.

在Git 2.0中,Git将默认为较为保守的简单"行为,该行为只会将当前分支推送到"git pull"用于更新当前分支的相应远程分支.

In Git 2.0, Git will default to the more conservative 'simple' behavior, which only pushes the current branch to the corresponding remote branch that 'git pull' uses to update the current branch.

请参阅"git help config"并搜索"push.default"以获取更多信息.
(简单"模式是在Git 1.7.11中引入的.如果您有时使用旧版本的Git,请使用类似的当前"模式,而不是简单")

See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.11. Use the similar mode 'current' instead of 'simple' if you sometimes use older versions of Git)

计数对象:完成841个.
最多可使用2个线程进行Delta压缩.
压缩对象:已完成100%(578/578).
书写对象:100%(835/835),31.79 MiB |已完成3.14 MiB/s.
总计835(增量196),已重用0(增量0)

Counting objects: 841, done.
Delta compression using up to 2 threads.
Compressing objects: 100% (578/578), done.
Writing objects: 100% (835/835), 31.79 MiB | 3.14 MiB/s, done.
Total 835 (delta 196), reused 0 (delta 0)

远程:警告:文件.git-rewrite/t/Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt为74.92 MB;这大于GitHub建议的最大文件大小50.00 MB
远程:警告:文件.git-rewrite/t/Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt为69.38 MB;这大于GitHub建议的最大文件大小50.00 MB

remote: warning: File .git-rewrite/t/Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt is 74.92 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB
remote: warning: File .git-rewrite/t/Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt is 69.38 MB; this is larger than GitHub's recommended maximum file size of 50.00 MB

远程:错误:GH001:检测到大文件.
远程:错误:跟踪:f013f5e75b4f35d07de5d2d9ef1116bd
远程:错误:有关详细信息,请参见 http://git.io/iEPt8g .
远程:错误:文件.git-rewrite/t/Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt为126.80 MB;这超出了GitHub的文件大小限制100.00 MB

remote: error: GH001: Large files detected.
remote: error: Trace: f013f5e75b4f35d07de5d2d9ef1116bd
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File .git-rewrite/t/Education/Coursera/Exploratory Data Analysis/Week1/household_power_consumption.txt is 126.80 MB; this exceeds GitHub's file size limit of 100.00 MB

致git@github.com:rbohac/IPython-Notebooks.git![远程拒绝]主机->主机(预接收挂钩被拒绝)
错误:无法将一些引用推送到'git@github.com:rbohac/IPython-Notebooks.git'

To git@github.com:rbohac/IPython-Notebooks.git ! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'git@github.com:rbohac/IPython-Notebooks.git'

推荐答案

请确保您的最新提交是正确的,因为BFG会假定这样做并使用您的最新提交来维护仓库的状态,同时BFG会重写和清理Git历史记录.BFG与'git-filter-branch'类似,但它是为更特定的目的而编写的实用程序,而git实用程序更广泛,具有更多功能,但牺牲了运行效率较低的缺点.当我从该来源获得所有这些信息时,请阅读有关BFG的文档以获取更多详细信息.

Ensure that your latest commit is correct because BFG will assume this and use your latest commit to maintain the status of your repo while it rewrites and cleans the Git history. BFG is similar to 'git-filter-branch' but is a utility written for a more specific purpose whereas the git utility is broader with more functionality at the sacrifice of operating less efficiently. Read the documentation on BFG for more specifics as I got all of this information from that source.

brew install bfg
bfg --strip-blobs-bigger-than 50M
git rm --cached XYZ
git commit --amend -CHEAD
git push

BFG将更新您的提交以及所有分支和标记,因此它们是干净的,但实际上不会删除任何内容.检查存储库以确保一切正确,然后清除缓存并运行'git gc'清除Git现在可以识别的有害数据,因为该数据已从历史记录中删除.

BFG will update your commits and all branches and tags so they are clean, but it doesn't physically delete anything. Examine the repo to make sure everything is correct and then clear cache and run 'git gc' to strip out the unwanted data which Git will now recognize because it has been removed from history.

这篇关于Github-文件XYZ为126.80 MB;这超出了GitHub的文件大小限制100.00 MB的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆