Gitential.com Inc.
- 874 Walker Rd Suite C., Dover, 19904, DE, USA
- info@gitential.com
- (650) 680 7697
Unfortunately, there are no easy ways on how to reduce the size of your git repositories. However, there are quite a few ways to keep your repositories down to an efficient and easily manageable size. Many of them are fairly simple and can be set up fairly quickly. But, they probably won’t help you if you are already exceeding your repository cap on Bitbucket, Github, Gitlab, or Azure DevOps. For this scenario, we can help you identify what to target when it becomes necessary to deal with a large respository.
As your git repository expands, the time developers wait on it to complete processes also increases. While there’ll always be some wait time involved, the cost difference between a well-managed and poorly managed git repository can be significant. Left unchecked, the size of your git repository can result in:
Time is a precious commodity if only because it’s charged by the hour. This provides an excuse to get geeky about the cost of processes.
What’s the cost of 1 minute per developer per day over a year? We’re glad you asked! The formula looks like this: (# of Developers * 261 Work Days * # of Minutes per day)/60) * Average Hourly Wage) = Cost
Applying software developer average wages in the US of $107k or $51.25 per hour, the base cost is about 4.35 hours or $225. Fully loaded, the annual cost of 1 minute per day swells to roughly $300. That’s trivial, yes, but wait!
While applicable to any process, we’re focusing on how to decrease the size of your git repository and the cost-benefit of doing so. If 10 developers are forced to wait 10 additional unnecessary minutes daily on their interactions with git, the cost swells to 435 hours or $30k. What then for 100 developers?
The interest here is not to obsess over how every minute is spent, but to be cognizant of how incremental inefficiency compounds over time. Some may focus on the $-cost, but the real economy here concerns the 2.7 months of possible extra development time for this scenario.
Git has no limit on repo size, but repository managers typically do cap repository sizes unless you work out special arrangements with them:
While providing a warning as you get close to their caps, they allow account managers to set their own repo size limit to avoid the disruptions of reaching their limits. Despite the caps, nearly everyone recommends Git repositories to be limited to 1 Gb and keeping individual files under 100 Mb.
There are projects that radically exceed these parameters, but they are more the exception than the rule. In 2017, Microsoft introduced its Git Virtual File System for working with the world’s largest git repository, exceeding 300 Gb. As noted in the linked article, “A clone from North Carolina with no proxy server took almost 25 minutes. With a proxy configured and up to date, it took 70 seconds… a 95% improvement.”
Some additional ways of how to reduce the size of your git repository include:
After you’ve deleted your unwanted files, branches, and tags, and rewritten your repo history, don’t forget to implement the preventative maintenance measures discussed previously.
The Developer Coefficient by Stripe indicates software developer inefficiency may be as high as 31.6%. As we all know, developers are lucky if they can spend half of their work hours actually coding. Now, one minute isn’t much. But the size of your git repository can be forcing your developers to wait longer and longer on their git processes. Over the course of a year, this can result in weeks and months of lost development time. The larger your team, the greater the impact.
In tech companies, we like to talk about how our systems have 99.9+% uptime. Using our initial example, the size of your git repository could be costing your team of 10 developers 2.7 months’ worth of development time. If so, that’s 2.25% right off the top. Again, the objective isn’t to be obsessing over how developers spend their every minute. It’s a matter of being mindful of work processes that can introduce inefficiency.
Article updated: August 17, 2022