Lately I have been using GitHub and I am wondering what is the repository size limit for files hosted on github.com?
5 Answers
Known limits
There are multiple repo size limits which apply.
Soft limit
As of 2023, as per the docs, this is 5 GB. If you exceed this limit, is possible that you will receive an email from GitHub Support.
We recommend repositories remain small, ideally less than 1 GB, and less than 5 GB is strongly recommended.
If you happen to receive a restricting email from GitHub Support for one or more public repos, please report it as a comment to this answer along with a link to the repos, including the circumstances surrounding it.
git push
warning limits
As of 2020, the archived docs (backup) excerpted below stated the following. It is reasonably assumed that this still applies. This limit can obviously be ignored.
If you reach 75GB, you'll receive a warning from Git in your terminal the next time you push a change.
Also, you'll receive a warning in the terminal for each file of over 50MB but under the hard limit.
Hard limits
As of 2023, although the docs don't state the per repository hard limit, it is reasonably assumed that the previously documented per repository hard limit of 100 GB still applies, at least until any theoretical email from GitHub Support is received. The docs, also excerpted below, state only the per file hard limit of 100 MB.
Individual files in a repository are strictly limited to a 100 MB maximum size limit.
As of 2020, the archived docs excerpted below stated that the hard limit is 100 GB per repository. Again, it is reasonably assumed that this hard limit still applies.
Repositories have a hard size limit of 100GB.
As of 2018, the documented (archive link) push size limit is 2 GB, although related considerations also apply for large pushes.
we don’t allow pushes over 2GB
Files can also be shared as binaries in a release. As of 2020, the documented size limit of each such file is 2 GB.
We don't limit the total size of the binary files in the release or the bandwidth used to deliver them. However, each individual file must be smaller than 2 GB.
Checking used size
The size of each repo to which you directly have Admin access, but not via a team, is shown at https://github.com/settings/repositories. Alternatively, the git-sizer tool can estimate the repo size locally.
Bypassing the file size limit
Compression can obviously be used for some files if this puts them under the limit.
Large files can be split into smaller chunks. If it works for your application, a tool such as tar
plus split
, or just split
alone, can be used to split a large file into smaller parts, such as 90 MB each.
Although Git LFS has separate quotas, it is however strictly advised to not use it, whether for binary or text files. This is due to the meager limits of its free plan as imposed by GitHub. If you made the mistake of using it, its usage can be checked and files can be removed from it.
Number of files
There is no established limit of the max number of files in a repo. A post from 2015 notes having 1.7 million files in a GitHub repo. Note that having 1 million files would restrict each file to a maximum average of 5 KB as per the soft limit of 5 GB or to 100 KB as per the presumed hard limit of 100 GB.
Number of commits
A user reported having a repo disabled at 22 million commits.
How to write
To be able to successfully push a large number of bytes using git, it is highly likely that you'll first have to configure http.postBuffer
to a sufficiently large value, with enough free system memory available.
Apart from using git, the other way to programmatically write files that are not updated much is to use the v3 REST or the v4 GraphQL APIs using a personal access token. When doing so, ensure that the user-specific hourly rate limit is not exceeded. Unlike with git, this API doesn't however seem to allow submitting an increment or a diff.
Encryption
It is possible to encrypt the contents of the entire repo or just some files while using git, with several caveats.
Comparison
For Bitbucket, consider this answer. As feasible, I would personally push to both GitHub and Bitbucket, providing an implicit backup.
As of 2022, GitLab (not GitHub) looks to be lowering its free quota from 10 GB per repo to a total of just 5 GB for all repos combined! You can see the total space used in your GitLab account.
-
2Yes it can as it follows the same pattern matching as .gitignore git-scm.com/docs/gitignore#_pattern_format, You can setup this with the command line (link below for tutorial), or by adding your patterns to .gitattributes; example: gist.github.com/nemotoo/b8a1c3a0f1225bb9231979f389fd4f3f. I highly recommend you look at the official site as well as the tutorial to get started github.com/git-lfs/git-lfs/wiki/Tutorial. Commented Apr 9, 2020 at 20:34
-
3I do know of a repo which reached that limit, it's the opengapps repo, Here are the two articles that explains what happened after: opengapps.org/blog/post/2019/02/17/github-situation opengapps.org/blog/post/2019/08/23/sourceforge-migration Commented Aug 22, 2020 at 0:22
-
3I received this email from GitHub in May 2019 for a 5 GB fork (github.com/whosonfirst-data/whosonfirst-data/issues/1507) as did other forks and the upstream (whosonfirst.org/blog/2019/05/09/changes). I deleted my fork, upstream split their 10+ GB? into smaller ones.– HugoCommented Oct 13, 2020 at 11:03
-
2You can also upload large binaries through github releases. No stated total limit or bandwidth limits though each binary is limited to 2GB. IIRC some projects with very high bandwidth usage received warnings. docs.github.com/en/free-pro-team@latest/github/…– qwrCommented Nov 14, 2020 at 8:04
-
3
From GitHub's documentation:
GitHub doesn't have any set disk quotas. We try to provide abundant storage for all Git repositories, within reason. Keeping repositories small ensures that our servers are fast and downloads are quick for our users.
and
In addition, we place a strict limit of files exceeding 100 MB in size.
Now for the non-canned part of my answer. GitHub might allow you to store files up to 100MB, but you should also be vigilant to not version binary or other similar blob type files. The reason for this is that Git doesn't handle binaries well, and storage can be a big penalty. So if you find yourself pushing 100MB per file, you should check what type of file you are dealing with.
According to the 2019 version of this page (archive) and https://help.github.com/articles/working-with-large-files/ there is not limit on the repo size, but after exceeding 1 GB they might email you and ask to reduce the size:
We recommend repositories be kept under 1GB each. This limit is easy to stay within if large files are kept out of the repository. If your repository exceeds 1GB, you might receive a polite email from GitHub Support requesting that you reduce the size of the repository to bring it back down.
Additionally you will see warnings for pushing files bigger than 50 MB and files bigger than 100 MB won't be accepted.
File and repository size limitations
To ensure good performance for our users, we recommend repositories be kept under 1GB each. Keeping repositories small ensures that our servers are fast and downloads are quick. If your repository does exceed 1GB, you might receive an email from GitHub Support asking you to reduce it.
Repositories have a hard size limit of 100GB. If you reach 75GB, you'll receive a warning from Git in your terminal the next time you push a change. In addition, we place a strict maximum size limit of 100 MB for individual files in a repository
Source: Github -> what-is-my-disk-quota
Note: If you add a file to a repository via a browser, the file can be no larger than 25 MB. For more information
Limits are increased. This is 500Mb per file. No limit for repository size. Unlimited repositories. These limits are for free accounts only. If you pay limits really increase.
Anyway, if github fit your project, you shouldn't care much about limits, the real purpose of github, even since microsoft acquiered it is to get your source code. Whatever you may think about that, they do provide interesting tools for teams and opensource codes. I would care much about hosting files on "somebody else computer" for compagny who really need security.
-
10
-
3How are limits supposed to increase if the free version is already unlimited??? Commented Aug 9, 2022 at 23:11