Make your monorepo feel small with Git’s sparse index
This is well written and deserves my upvote, because sparse-checkout is part of git and knowing how it works is useful.<p>That said, there&#x27;s absolutely no reason to structure your code in a monorepo.<p>Here&#x27;s what I think GitHub is doing:<p>1)  Encourage monorepo adoption<p>2)  Build tooling for monorepos<p>3)  Selling tooling to developers stranded in monorepos<p>Microsoft, which owns GitHub, created the microsoft&#x2F;git fork linked in the article, and they explain their justification here: <a href="https:&#x2F;&#x2F;github.com&#x2F;microsoft&#x2F;git#why-is-this-fork-needed" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;microsoft&#x2F;git#why-is-this-fork-needed</a><p>&gt; Well, because Git is a distributed version control system, each Git repository has a copy of all files in the entire history. As large repositories, aka monorepos grow, Git can struggle to manage all that data. As Git commands like status and fetch get slower, developers stop waiting and start switching context. And context switches harm developer productivity.<p>I believe that Google&#x27;s brand is so big that it led to this mass cognitive dissonance, which is being exploited by GitHub.<p>To be clear, here are the two ideas in conflict:<p>*  Git is decentralized and fast, and Google famously doesn&#x27;t use it.<p>*  Companies want to use &quot;industry standard&quot; tech, and Google is the standard for success.<p>Now apply those observations to a world where your engineers only use &quot;git&quot;.<p>The result is market demand to misuse git for monorepos, which Microsoft is pouring huge amounts of resources into enabling via GitHub.<p>It makes great sense that GitHub wants to lean into this.  More centralization and being more reliant on GitHub&#x27;s custom tooling is obviously better for GitHub.<p>It just so happens that GitHub is building tools to enable monorepos, essentially normalizing their usage.<p>Then GitHub can sell tools to deal with your enormous monorepo, because your traditional tools will feel slow and worse than GitHub&#x27;s tools.<p>In other words, GitHub is propping up the failed monorepo idea as a strategy to get people in the pipeline for things like CodeSpaces: <a href="https:&#x2F;&#x2F;github.com&#x2F;features&#x2F;codespaces" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;features&#x2F;codespaces</a><p>Because if you have 100 projects and they&#x27;re all separate, you can do development locally for each and it&#x27;s fast and sensible.  But if all your projects are in one repo, the tools grind to a halt, and suddenly you need to buy a solution that just works to meet your business goals.