> Markdown version of [/videos/1236-how-a-small-team-shrank-a-microsoft-monorepo-by-94?t=321](https://www.wearedevelopers.com/videos/1236-how-a-small-team-shrank-a-microsoft-monorepo-by-94?t=321). Every page supports `.md` or `Accept: text/markdown`. Links point to the HTML versions so they work for humans too. Agent guide: [/agents.md](https://www.wearedevelopers.com/agents.md). --- # How a Small Team Shrank a Microsoft Monorepo by 94% Microsoft's monorepo inexplicably ballooned to 170GB due to a legacy 2006 Git flaw. Discover how a small team fixed the core algorithm to shrink clone sizes by 94%. - **Speakers:** Jonathan Creamer - **Event:** Coffee With Developers - **Published:** November 6, 2024 - **Duration:** 33:23 - **URL:** https://www.wearedevelopers.com/videos/1236-how-a-small-team-shrank-a-microsoft-monorepo-by-94 ## Summary Microsoft's One JS engineering system supports a massive TypeScript monorepo for Office.com, managing 2,000 packages and 20 million lines of code for over 1,000 active developers. Despite anticipating scale, the Git repository inexplicably ballooned from under 2 GB to over 170 GB. The culprit was surprisingly not the source code itself, but the versioning branch populated by Beachball, an automated open-source tool for managing packaging and changelogs. Because of the volume of commits, pushes to this branch were generating 40-megabyte payloads strictly for changelogs and JSON updates instead of the expected kilobytes, bringing remote cloning and local engineering performance to a near halt. Working alongside Git core contributor Derrick Stolee, the team traced the bloat back to a 2006 delta computation limitation within Git's core codebase. Server-side packing and local pushing historically relied on the last 15 to 16 characters of a filename to compute diffs. As a result, Git aggressively collided the diffs of unrelated markdown paths (e.g., diffing a button component's changelog against a dropdown's changelog), failing to find a delta match and defaulting to appending the entire changelog file repeatedly. By replacing this legacy diffing mechanism with a new Path Walk algorithm for git push and git repack commands, the team eliminated the diff mismatch, successfully slashing the One JS local clone size by 94% down to just 4 GB. Beyond core Git updates, effectively scaling massive monorepos requires strict continuous hygiene. Consolidating tens of thousands of generated files into a single directory inherently degrades performance by forcing Git to build excessively large tree objects upon every append. Furthermore, carelessly tracking visual regression artifacts or compiled React Native binaries permanently bloats Git history since binaries inherently bypass Git's plain-text delta computation. To help developer tools and platform engineering teams proactively audit their environments, the Microsoft Git fork formally introduced the git survey command as an embedded alternative to external tools, allowing teams to detect severe blob weight anomalies and prevent silent architectural debt. **Keywords:** monorepo size optimization, git path walk algorithm, azure devops repository scaling, beachball changelog scaling, git delta computation hash collision, large git tree objects, git survey blob anomaly detection, git repack strategies, microsoft one js monorepo, javascript DevOps tools, preventing binary git bloat, git monorepo clone performance, open source git contributions, linus torvalds git hash limitation ## Chapters 1. **Managing Microsoft's massive global UI monorepo** (00:02) — An overview of the One JS engineering system supporting thousands of active developers. 1. **Investigating massive Git repository growth from changelog strategies** (01:25) — How standard changelog practices and tool integrations caused an unprecedented increase in Git repository size. 1. **Investigating push inefficiencies with upstream Git experts** (05:21) — Discovering that adding tiny text lines to large JSON files triggered massive file push sizes due to Azure DevOps packing rules. 1. **Uncovering a legacy object hashing collision in Git** (11:43) — How a 2006 file name hashing limitation forced unchanged files to be completely re-pushed. 1. **Re-architecting Git packing with path walk algorithms** (15:20) — Implementing a path-based traversal algorithm to correctly compute file deltas during repository repacking and pushing. 1. **Resolving repository bloat with specific Git configurations** (19:14) — Which Git configurations developers can set locally to resolve pushing and repacking issues. 1. **Analyzing massive blobs with the Git survey command** (22:03) — How a new native built-in utility replaces external Python tools to identify problematic binaries. 1. **Avoiding common large file pitfalls inside massive repositories** (23:59) — Strategies for preventing generated text, visual regression artifacts, and binaries from inflating Git history. 1. **Developing an open-source first engineering team culture** (29:54) — The benefits of contributing internal monorepo tooling fixes back into the broader developer community ecosystem. ## Related Moments - [Overcoming challenges of scaling legacy monolithic frontend applications](https://www.wearedevelopers.com/videos/236-microfrontends-at-scale) (from "Microfrontends at Scale") - [Bottlenecks of scaling monolithic frontend architectures](https://www.wearedevelopers.com/videos/100153-microfrontends-lessons-learned-from-growing-a-design-system-and-shared-libraries-across-20-teams) (from "Microfrontends: Lessons Learned from Growing a Design System and Shared Libraries Across 20+ teams") - [Leveraging repository data to restructure and optimize teams](https://www.wearedevelopers.com/videos/100189-repository-as-network-visualizing-collaboration-in-git) (from "Repository as Network: Visualizing Collaboration in git") - [Accelerating continuous integration builds with affected tools](https://www.wearedevelopers.com/videos/5-sustainable-angular-architectures-with-nx-and-strategic-design) (from "Sustainable Angular Architectures with Nx and Strategic Design") - [Common questions and the limitations of Git history](https://www.wearedevelopers.com/videos/603-ask-your-code) (from "Ask Your Code") - [Exploring the core benefits of adopting GitOps](https://www.wearedevelopers.com/videos/547-how-to-gitops-your-cluster-with-flux) (from "How to GitOps your cluster with Flux") ## Related Articles - [How Microsoft worked around a Git limitation to shrink a repository by 94%](https://www.wearedevelopers.com/magazine/499-how-microsoft-worked-around-a-git-limitation-to-shrink-a-repository-by-94) - [Dev Digest 125 - Duck and Cover](https://www.wearedevelopers.com/magazine/462-dev-digest-125-duck-and-cover) - [Dev Digest 107 - And the OSScar goes to…](https://www.wearedevelopers.com/magazine/405-dev-digest-107-and-the-osscar-goes-to) - [Dev Digest 131 - AI'm not sure about OSS](https://www.wearedevelopers.com/magazine/472-dev-digest-131-ai-m-not-sure-about-oss) ## Related Jobs - [Senior Software Engineer](https://www.wearedevelopers.com/jobs/ext/15942-senior-software-engineer) at **GitHub** - [Principal Product Manager, Agent Platform](https://www.wearedevelopers.com/jobs/ext/277541-principal-product-manager-agent-platform) at **GitHub** - [Senior Software Engineer, Enterprise Products](https://www.wearedevelopers.com/jobs/ext/1841248-senior-software-engineer-enterprise-products) at **GitHub** - [Senior Software Engineer](https://www.wearedevelopers.com/jobs/ext/159190-senior-software-engineer) at **GitHub** - [Staff Developer Advocate, GitHub Security Lab](https://www.wearedevelopers.com/jobs/ext/1921051-staff-developer-advocate-github-security-lab) at **GitHub** - [Senior Software Engineer,Billing](https://www.wearedevelopers.com/jobs/ext/1991843-senior-software-engineer-billing) at **GitHub**