---
title: "Sapling: Source control that’s user-friendly and scalable"
description: "Meta has open-sourced the client for Sapling, a Git-compatible source control system built over 10 years that scales to repositories with tens of millions of files, commits and branches."
url: "https://swe.quest/articles/sapling-source-control-that-s-user-friendly-and-scalable-ac4727ee939b435e"
canonical: "https://engineering.fb.com/2022/11/15/open-source/sapling-source-control-scalable/"
source: "Meta Engineering"
published: "2022-11-15"
difficulty: "easy"
kind: "Announcement"
reading_minutes: 11
tags: ["version-control","developer-tools","code-review","scalability","open-source"]
---

# Sapling: Source control that’s user-friendly and scalable

A post on [Meta Engineering](https://swe.quest/sources/meta.md), published 2022-11-15, 11 min read, Announcement. Original: [https://engineering.fb.com/2022/11/15/open-source/sapling-source-control-scalable/](https://engineering.fb.com/2022/11/15/open-source/sapling-source-control-scalable/)

## Summary

Meta has open-sourced the client for Sapling, a Git-compatible source control system built over 10 years that scales to repositories with tens of millions of files, commits and branches. Its UX centers on smartlog (a filtered view of your relevant commits), extensive undo/recovery commands, and first-class commit stacks backed by tracked mutation history, plus ReviewStack, a demo UI for reviewing GitHub PRs commit by commit. For scale, Segmented Changelog downloads only the commit graph's shape and lazily fetches data, answering ancestry queries in O(number-of-merges) and file history in O(log n). Sparse profiles committed to the repo, Watchman integration, and a forthcoming virtual file system and Rust server handle the working copy.

Written by swe.quest, not by the author.

**Difficulty:** Easy: no special background needed; explains what something is and why it matters

## Topics

- [Version control](https://swe.quest/tags/version-control.md) (Engineering practices)
- [Developer tools](https://swe.quest/tags/developer-tools.md) (Engineering practices)
- [Code review](https://swe.quest/tags/code-review.md) (Engineering practices)
- [Scaling](https://swe.quest/tags/scalability.md) (Distributed systems)
- [Open source](https://swe.quest/tags/open-source.md) (Engineering practices)

## Prerequisites

- Git basics
- commit stacks and rebasing

## Keywords

Sapling, Segmented Changelog, ReviewStack, Mercurial, Watchman, Git LFS, Git

## Related posts

- [Branching in a Sapling Monorepo](https://swe.quest/articles/branching-in-a-sapling-monorepo-3c90aca74756181a.md): Meta Engineering · 2025-10-16 · Medium · 7 min read · Version control, Developer tools, Build systems
  Meta's Sapling monorepo handles branching with two workflows: non-mergeable full-repo branching via sl bookmark for short-lived release branches, and mergeable directory branching via sl subtree for long-lived variants.
- [Redesigning source control at Anthropic](https://swe.quest/articles/redesigning-source-control-at-anthropic-ecdbb37746353304.md): Anthropic Engineering · 2026-10-13 · Medium · 17 min read · Version control, System design, Caching, Scaling, AI for coding
  Anthropic replaced git with Scion, an in-house centralized version control system, after its monorepo grew past what git mirrors could serve.
- [WebKit on GitHub!](https://swe.quest/articles/webkit-on-github-d3587a8b64d71587.md): WebKit · 2022-08-31 · Easy · 2 min read · Version control, Open source, Browsers
  WebKit froze its Subversion tree on June 23rd and moved source control to git hosted on GitHub, citing git's distributed collaboration model, its author/committer model, cheap branch and revert operations, and the fact that most contributors already worked from git-svn mirrors.
- [Turn one giant AI-generated pull request to a reviewable stack](https://swe.quest/articles/turn-one-giant-ai-generated-pull-request-to-a-reviewable-stack-e48d2499a5268109.md): GitHub Engineering · 2026-08-04 · Medium · 9 min read · Code review, Version control, AI for coding, Developer tools
  Stacked pull requests split a large, agent-generated feature diff into a chain of small, dependency-ordered PRs that are each scoped to one concern.
- [Merging two GitHub repositories without losing commit history](https://swe.quest/articles/merging-two-github-repositories-without-losing-commit-history-7428e9ac84244059.md): Mozilla Hacks · 2022-08-29 · Medium · 15 min read · Version control, Developer tools
  MDN merged small example repositories into a larger parent repo while keeping full commit history, using only plain git commands.

Browse: [Latest posts](https://swe.quest/index.md) · [Topics](https://swe.quest/tags.md) · [Sources](https://swe.quest/sources.md) · [Topic map](https://swe.quest/map.md) · [Site guide (llms.txt)](https://swe.quest/llms.txt)
