Fundamentals 10 min read

Why Facebook Dropped Git for Mercurial: Performance, Scaling, and Organizational Decisions

The article investigates why Facebook abandoned Git in favor of Mercurial, detailing performance bottlenecks with massive repositories, alternative tool evaluations, the migration process, and how human factors and collaboration shaped the final decision.

Selected Java Interview Questions
Selected Java Interview Questions
Selected Java Interview Questions
Why Facebook Dropped Git for Mercurial: Performance, Scaling, and Organizational Decisions

The author, Greg Foster, explores why Facebook moved away from Git to Mercurial, drawing on interviews, engineering talks, and personal research to uncover the motivations behind this tooling shift.

Initially, Facebook used Git, but by 2012 the sheer size of their codebase—far larger than the Linux kernel—caused Git operations to become painfully slow, with basic commands taking over 45 minutes due to costly file stat operations.

Attempts to improve Git performance with its maintainers were rebuffed; they suggested repository sharding, which Facebook deemed impractical. Consequently, the team evaluated alternatives such as Perforce and Bitkeeper, ultimately selecting Mercurial for its clearer architecture and Python‑based extensibility.

After a Mercurial hackathon in Amsterdam, Facebook committed to a full migration, carefully mapping Git commands to Mercurial equivalents, addressing developer concerns, and promoting the new workflow across the organization.

Facebook contributed performance enhancements to Mercurial, integrated stacked diffs into their review process, and influenced downstream tools, illustrating how collaboration with open‑source maintainers can drive large‑scale adoption.

The concluding lesson emphasizes that major technical decisions are often driven by people and culture rather than pure performance metrics; Facebook chose Mercurial because of the openness and partnership it offered, not because it was objectively superior.

Source: https://engineering.fb.com/2014/01/07/core-infra/scaling-mercurial-at-facebook/

Note: The author has never worked at Facebook and gathered information through external interviews and publicly available materials.

交流技术 职位内推 行业探讨

performanceSoftware Engineeringgitversion controlMercurialTool Migration
Selected Java Interview Questions
Written by

Selected Java Interview Questions

A professional Java tech channel sharing common knowledge to help developers fill gaps. Follow us!

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.