You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: content/repositories/creating-and-managing-repositories/repository-limits.md
+53-1Lines changed: 53 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -9,14 +9,66 @@ topics:
9
9
- Repositories
10
10
---
11
11
12
-
Certain types of repository resources can be quite large, requiring excessive processing on {% data variables.product.github %}. Because of this, limits are set to ensure requests complete in a reasonable amount of time.
12
+
Certain types of repository resources can be quite large, requiring excessive processing on {% data variables.product.github %}. Because of this, limits are set to ensure requests complete in a reasonable amount of time. Exceeding the recommended maximum limit increases the risk of degraded repository health, which includes, but is not limited to, slow response times for basic Git operations and UI latency.
13
+
14
+
>[!NOTE] While following these guidelines can improve repository stability, it does not guarantee supportability, as other factors may lead to unexpected behavior.
13
15
14
16
Most of the limits below affect both {% data variables.product.github %} and the API.
15
17
18
+
## Repository size
19
+
20
+
To ensure optimal performance and manageability, we recommend staying within the following maximum limits for repository structure and size.
21
+
22
+
***On-disk size**: 10 GB
23
+
24
+
On-disk size refers to the size of the `.git` folder (the compressed form of the repository). Large repositories can slow down fetch operations and increase clone times for developers and CI. To manage repository size:
25
+
26
+
* Use {% data variables.large_files.product_name_long %} ({% data variables.large_files.product_name_short %}) for binary files.
27
+
* Store programmatically generated files outside of Git, such as in object storage.
28
+
29
+
***Directory width (number of entries in a single directory)**: 3,000
30
+
31
+
Directories containing numerous frequently modified files can significantly increase repository maintenance costs and degrade the performance of basic Git operations. Segmenting files into a shallow directory structure will reduce the size of these trees and result in less new data created.
32
+
33
+
***Directory depth**: 50
34
+
35
+
Deep directory trees can make history-walking operations slower.
36
+
37
+
***Number of branches**: 5,000
38
+
39
+
Large numbers of branches can result in unnecessary data in fetch operations, leading to slow transfer times or in extreme cases throttled repository performance.
40
+
41
+
## Activity
42
+
43
+
To avoid throttling and performance issues, we recommend staying within the following operational limits.
44
+
45
+
***Push size**: This limit is enforced at 2GB.
46
+
***Single object size**:
47
+
48
+
The recommended maximum limit is 1MB. This is enforced at 100MB. To track large files in a Git repository, we recommend using {% data variables.large_files.product_name_short %}. See [AUTOTITLE](/repositories/working-with-files/managing-large-files/about-git-large-file-storage).
49
+
50
+
***Git read operations (e.g. fetches, clones)**:
51
+
52
+
The recommended maximum limit is 15 operations per second per repository. Large amounts of read operations can result in throttled performance for a repository. Automated processes such as CI, machine users, or third-party applications, can degrade a repository's performance in some cases. Consider optimizing your CI's clone strategy and/or using a repository cache server. Note that shallow clones will impose less cost and burden on the server than full clones and therefore may perform better.
53
+
54
+
***Push rate**: The recommended maximum limit is 6 pushes per minute per repository.
55
+
16
56
## Text limits
17
57
18
58
{% data variables.product.prodname_dotcom %} displays formatted previews of some files, such as Markdown and Mermaid diagrams. {% data variables.product.prodname_dotcom %} always attempts to render these previews if the files are small (generally less than 2 MB), but more complex files may time out and either fall back to plain text or not be displayed at all. These files are always available in their raw formats, which are served through `{% data variables.product.raw_github_com %}`; for example, `https://{% data variables.product.raw_github_com %}/octocat/Spoon-Knife/master/index.html`. Click the **Raw** button to get the raw URL for a file.
19
59
60
+
## Pull requests limits
61
+
62
+
To reduce delays and performance issues in repositories with high pull request activity, we recommend staying within the following limits.
63
+
64
+
***Open pull requests (against the same branch)**: 1,000
65
+
66
+
Having many open pull requests targeting the same branch can slow down mergeability checks or lead to timeouts. If you're using a merge queue, consider disabling the "require this branch to be up to date before merging" setting. This limits mergeability checks to only the pull requests in the queue.
67
+
68
+
***Pull request merge rate**: 1 merged pull request per minute
69
+
70
+
Each merge triggers mergeability checks for all open pull requests, which can cause performance bottlenecks—especially in busy repositories. This can also lead to a race-to-merge situation that impacts developer productivity. To reduce load, disable the "require this branch to be up to date before merging" setting when using a merge queue.
71
+
20
72
## Diff limits
21
73
22
74
Because diffs can become very large, we impose these limits on diffs for commits, pull requests, and compare views:
0 commit comments