The .NET team built a Virtual Monolithic Repository (VMR) that aggregates source code from dozens of standalone repositories into a single git repository for unified builds. The VMR uses a custom two-way synchronization algorithm based on git patches to keep changes flowing between product repositories and the monorepo. The synchronization evolved through three stages: tarball-based Source Build, read-only VMR-lite with one-way sync, and finally a writable VMR with bidirectional flow. The team encountered challenges with conflicting changes, branch lifecycle mismatches, and metadata corruption, ultimately settling on a rebase-based approach that handles conflicts interactively. This infrastructure now powers .NET SDK builds starting from .NET 10 Preview 4.

37m read timeFrom devblogs.microsoft.com
Post cover image
Table of contents
What is The Virtual Monolithic Repository Copy linkThe Road to the VMR Copy linkVMR’s Storage Model Copy linkMoving Changes Copy linkTracking the Sources Copy linkOne-Way Synchronization Copy linkTwo-way Synchronization Copy linkPresent Challenges Copy linkWhat Was Not Covered Copy linkConclusion Copy linkResources Copy link

Sort: