git Github 文件大小限制已于 2013 年 6 月 18 日更改。现在不能推
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/17382375/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Github file size limit changed 6/18/13. Can't push now
提问by slindsey3000
How does this change as of June 18, 2013 affect my existing repository with a file that exceeds that limit? I last pushed 2 months ago with a large file.
自 2013 年 6 月 18 日起,此更改如何影响我的现有存储库的文件超出该限制?我上次推送了一个大文件是在 2 个月前。
I have a large file that I have removed locally but I can not push anything now. I get a "remote error" ... remote: error: File cron_log.log is 126.91 MB; this exceeds GitHub's file size limit of 100 MB
我有一个已在本地删除的大文件,但现在无法推送任何内容。我收到“远程错误”...远程:错误:文件 cron_log.log 为 126.91 MB;这超出了 GitHub 的 100 MB 文件大小限制
I added the file to .gitignore after original push... But it still exists on remote (origin)
我在原始推送后将文件添加到 .gitignore ......但它仍然存在于远程(来源)上
Removing it locally should get rid of it at origin(Github) right? ... but ... it is not letting me push because there is a file on Github that exceeds the limit...
在本地删除它应该在原点(Github)上删除它,对吗?......但是......它不让我推,因为Github上有一个超过限制的文件......
https://github.com/blog/1533-new-file-size-limits
https://github.com/blog/1533-new-file-size-limits
These are the commands I issued plus error messages..
这些是我发出的命令加上错误消息..
git add . git commit -m "delete cron_log.log" git push origin master remote: Error code: 40bef1f6653fd2410fb2ab40242bc879 remote: warning: Error GH413: Large files detected. remote: warning: See http://git.io/iEPt8g for more information. remote: error: File cron_log.log is 141.41 MB; this exceeds GitHub's file size limit of 100 MB remote: error: File cron_log.log is 126.91 MB; this exceeds GitHub's file size limit of 100 MB To https://github.com/slinds(omited_here)/linexxxx(omited_here).git ! [remote rejected] master -> master (pre-receive hook declined) error: failed to push some refs to 'https://github.com/slinds(omited_here)
I then tried things like
然后我尝试了类似的事情
git rm cron_log.log
git rm --cached cron_log.log
Same error.
同样的错误。
回答by Chronial
As rlb.usanoted, Github has added a file size limit that prevents you from pushing files > 100MB. You tried to remove the file in a new commit and tried to push that. That fails, because you are not just pushing that last commit, but also three others. Those three commits contain versions of cron_log that are 141MB and 126MB in size. They cause your push to fail.
正如rlb.usa 所指出的,Github 已经添加了文件大小限制,以防止您推送大于 100MB 的文件。您尝试在新提交中删除该文件并尝试推送该文件。那失败了,因为您不仅要推动最后一次提交,还要推动其他三个提交。这三个提交包含大小为 141MB 和 126MB 的 cron_log 版本。它们会导致您的推送失败。
To fix that, you have two options:
要解决这个问题,您有两个选择:
- Run
git rebase -i origin/master
, set every commit to edit and remove the file in each withgit commit --amend
. - Use the BFG Repo-Cleanerto clean all your history.
- 运行
git rebase -i origin/master
,设置每个提交以编辑和删除每个文件中的文件git commit --amend
。 - 使用BFG Repo-Cleaner清理您的所有历史记录。
回答by liuggio
Hi you could solve easily in this way:
嗨,您可以通过这种方式轻松解决:
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch FILENAME.TAR'
--prune-empty --tag-name-filter cat -- --all
git filter-branch --force --index-filter 'git rm --cached --ignore-unmatch FILENAME.TAR'
--prune-empty --tag-name-filter cat -- --all
link: https://help.github.com/articles/remove-sensitive-data
回答by rlb.usa
According to GitHub's new file size limit(also: working with large files), instituted only hours ago, GitHub now has new policies of a 1GB filesize repository, warnings for pushes of files over 50 MB and complete rejection for fileuploads of 100MB.
根据 GitHub几个小时前制定的新文件大小限制(也:处理大文件),GitHub 现在拥有 1GB 文件大小存储库的新政策,推送超过 50 MB 的文件时发出警告,并完全拒绝 100 MB 的文件上传。
GitHub warns you when you push a file larger than 50 MB. We'll reject pushes containing files larger than 100 MB. We do this for a few reasons.
当您推送大于 50 MB 的文件时,GitHub 会警告您。我们将拒绝包含大于 100 MB 的文件的推送。我们这样做有几个原因。
You have a few options, but not many:
你有几个选择,但不是很多:
- Upload your 100 MB+ files to a different service and share with that instead
- Reduce the filesize of problematic files
- Find a new repository
- 将 100 MB 以上的文件上传到其他服务并与之共享
- 减少有问题的文件的文件大小
- 找到一个新的存储库
回答by Franck Dernoncourt
The actual limit for each file on GitHub is 100 MiB, not 100 MB.
GitHub 上每个文件的实际限制是 100 MiB,而不是 100 MB。
Demo: https://github.com/Franck-Dernoncourt/github-max-file-size
演示:https: //github.com/Franck-Dernoncourt/github-max-file-size
https://help.github.com/articles/what-is-my-disk-quota/(mirror) erroneously claims that they place a strict limit of files exceeding 100 MB in size
https://help.github.com/articles/what-is-my-disk-quota/(镜像)错误地声称他们严格限制超过 100 MB 的文件大小
The confusion between MB and MiB can be seen when pushing: in the example below, the error message from GitHub server indicates the file is 101 MB whereas git correctly indicates it is 101 MiB:
推送时可以看出 MB 和 MiB 之间的混淆:在下面的示例中,来自 GitHub 服务器的错误消息指示文件为 101 MB,而 git 正确指示它为 101 MiB:
~\Documents\GitHub\test123 [master ↑1 +3 ~0 -0 !]> git push
Counting objects: 3, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 101.03 MiB | 896.00 KiB/s, done.
Total 3 (delta 1), reused 0 (delta 0)
remote: Resolving deltas: 100% (1/1), completed with 1 local objects.
remote: error: GH001: Large files detected. You may want to try Git Large File S
torage - https://git-lfs.github.com.
remote: error: Trace: e9206a9cd05c4ff5de79bba9d4caf9df
remote: error: See http://git.io/iEPt8g for more information.
remote: error: File 101MB is 101.00 MB; this exceeds GitHub's file size limit of
100.00 MB
To https://github.com/Franck-Dernoncourt/test123.git
! [remote rejected] master -> master (pre-receive hook declined)
error: failed to push some refs to 'https://github.com/Franck-Dernoncourt/test12
3.git'
~\Documents\GitHub\test123 [master ↑1 +3 ~0 -0 !]>
回答by ash8
I tried a couple of the above answers with no luck. But eventually I found a solution using Github Desktop. Click 'Repository', 'Undo most recent commit'. It allowed me to do it twice, just enough to remove the offending commit. (I had already deleted the large files from the repository).
我尝试了上面的几个答案,但没有运气。但最终我找到了使用 Github Desktop 的解决方案。单击“存储库”、“撤消最近提交”。它允许我做两次,足以删除违规提交。(我已经从存储库中删除了大文件)。
回答by Amir Rubin
Use this Python script to clean your repo of large files (I used it to on my repo and it worked great) https://gist.github.com/1433794
使用这个 Python 脚本来清理你的大文件存储库(我在我的存储库中使用它并且效果很好)https://gist.github.com/1433794