The maximum Git repo size limit is debatable and depends on Git hosting platforms after all. A good example of a large repo size, would be monorepos. A monorepo is a singular repository where multiple projects are stored. To not get off track, let’s see how can we measure the common repo size and what are the limits.
find git repo size
Step 1. First run the garbage collector to cleanup some space:
To learn a bit more about
git gc → Git 101: gc.
Step 2. Get current repo size:
git count-objects -vH | grep 'size-pack'
For a more detailed information, I strongly suggest installing git-sizer.
git hosting platform limits
By default, GitHub doesn’t allow files larger than 100MB, although with Git LFS (Large File Storage mostly used in combination with monorepos) you are allowed to push files from 2GB with the Free tier and up to 5GB if signed up for the GitHub Enterprise Cloud.
Regarding repo sizes, the hard size limit is set to 100GB. Though ideally should be less than 1GB and strongly recommended under 5GB.
As for the main GitHub competitor, GitLab’s repository size limit is 10GB including Git LFS. The maximum push size is 5GB though.
Among the top 3 Git hosting platform providers, Atlassian’s product called BitBucket recommends repo size limit no larger than 2GB. The actual hard size limit is 10GB, and push size being no larger than 3.5GB.