GitHub Repository Size Limits: GitHub places with file as well repository size limits to make things running smoothly and usable. Detailed analysis of these limitations are as follows:
File Size Limits
WARNING 50 MB file size limit: Git will warn you should you try to add or update a file over 50MB. This is intentionally done to prevent repository from increasing in size23.GitHub Limits (ad)
Hard limit of 100 MB per commit: invalid files can no longer be pushed to a repository. In case you are working with bigger documents, users should make use of a better solution than git which is the Git Large File Storage (Git LFS), being specifically made for managing large files14.
Recommended Repository Sizes
Optimal Size: GitHub recommends you to keep your repositories under 1 GB for a better performance. Going over this limit will receive a warning message from GitHub Support to downsize the size23.
5 GB Soft Limit: On 2023 it would be added to the storage recommendations email➁ according to this soft limit and asking your repositories already reached that size, you should start thinking about optimize use of their disk space4.
Handling Large Files
Large Files — Git LFS: To handle files larger than 100 MB, Git LFS lets us keep the original file at a different storage (and only reference its pointer within our repository). This approach keeps the repository lean while supporting large files35.
Use external storage for large binary files:To avoid running into these limits, consider storing your very large binaries in an external repository and downloading it during the build. Best practices This leads to better space management in combination with collaboration and performance3.
To become an effective GitHub repository manager it is important to understand the size limitations as described here, consider this in your own documentation and be aware of how best you can use them too! One way of reducing the overheads associated with large files, is to use tools like Git LFS which ensure that your repository remains in good shape.