git Git中的最大文件大小和最大存储库大小?
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/3230721/
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
Max file size and max repository size in Git?
提问by vengateswaran c
I'm looking to have Git as the primary source control for my employer (250 people) company. Before proceeding further I would like to have answers to the following questions.
我希望将 Git 作为我的雇主(250 人)公司的主要源代码控制。在继续之前,我想先回答以下问题。
Does Git have any specific max file size limit that it can handle? If so, what is it?
What is the max repository size recommended by Git? This would help me determine the housekeeping I should set on the repository.
Git 是否有它可以处理的任何特定的最大文件大小限制?如果是,那是什么?
Git 推荐的最大存储库大小是多少?这将帮助我确定应该在存储库上设置的内务处理。
回答by VonC
As mentioned in Git limits, Git has no file size or file number limit per se.
But it:
正如Git 限制 中提到的,Git 本身没有文件大小或文件数量限制。
但它:
- Won't manage large files too well (which is why a project like Git-BigFilesexists)
- Tag every file within its repository, which is why, if you have many different sets of files which each have their own development life-cycle, it is better to use severalGit repositories anyway (see true nature of submodules).
That approach is more suited to a component-driven development, and is quite different from the SVN external.
- 不会很好地管理大文件(这就是存在像Git-BigFiles这样的项目的原因)
- 标记其存储库中的每个文件,这就是为什么,如果您有许多不同的文件集,每个文件集都有自己的开发生命周期,无论如何最好使用多个Git 存储库(请参阅子模块的真实性质)。
这种方法更适合于组件驱动的开发,与SVN 的外部.
回答by user2454691
Rule of thumb: 1GB per repository, 100MB per file
经验法则:每个存储库 1GB,每个文件 100MB
For best performance, github recommend repositories be kept under 1GB each. This limit is easy to stay within if large files (typically, binaries) are kept out of the repository. If your repository exceeds 1GB, you might receive a polite email from support requesting that you reduce the size of the repository to bring it back down under 1GB.
为了获得最佳性能,github 建议每个存储库保持在 1GB 以下。如果将大文件(通常是二进制文件)保留在存储库之外,则很容易保持此限制。如果您的存储库超过 1GB,您可能会收到一封来自支持人员的礼貌电子邮件,要求您减小存储库的大小以将其恢复到 1GB 以下。
In addition, we place a strict limit of files exceeding 100 MB in size. For more information on why this is, see our article on working with large files.
此外,我们对超过 100 MB 的文件进行了严格限制。有关原因的更多信息,请参阅我们关于处理大文件的文章。
Look at: Managing Large Files / What is my disk quota?(it refers to both GitHub and Git capabilities.)
看:管理大文件/我的磁盘配额是多少?(它指的是 GitHub 和 Git 功能。)
回答by Kim Sullivan
As of 2018-04-20 Git for Windows has a bugwhich effectively limits the file size to 4GB max using that particular implementation (this bug propagates to lfs as well).
截至 2018 年 4 月 20 日,Windows 版 Git 存在一个错误,使用该特定实现有效地将文件大小限制为最大 4GB(此错误也会传播到 lfs)。