---
title: "Scaling merge-ort across GitHub"
description: "GitHub replaced its libgit2-based server-side merge and rebase implementation with Git's merge-ort strategy, which needs no working directory and matches what the Git command line does."
url: "https://swe.quest/articles/scaling-merge-ort-across-github-6d05304b446e2f08"
canonical: "https://github.blog/engineering/infrastructure/scaling-merge-ort-across-github/"
source: "GitHub Engineering"
published: "2023-07-27"
difficulty: "medium"
kind: "Case study"
reading_minutes: 5
tags: ["version-control","performance","deployment"]
---

# Scaling merge-ort across GitHub

A post on [GitHub Engineering](https://swe.quest/sources/github.md), published 2023-07-27, 5 min read, Case study. Original: [https://github.blog/engineering/infrastructure/scaling-merge-ort-across-github/](https://github.blog/engineering/infrastructure/scaling-merge-ort-across-github/)

## Summary

GitHub replaced its libgit2-based server-side merge and rebase implementation with Git's merge-ort strategy, which needs no working directory and matches what the Git command line does. Both changes were validated with Scientist experiments that ran old and new code paths side by side in production. For merges, P50 dropped from about 71 ms to under 8 ms and P99 from 1.63 s to about 330 ms, a 10x speedup on the github/github monolith. Rebases moved to the new git-replay subcommand, and in testing they took under 10 minutes of compute versus 2.56 hours with libgit2.

Written by swe.quest, not by the author.

**Difficulty:** Medium: assumes a working developer; shows how it is built or done

## Topics

- [Version control](https://swe.quest/tags/version-control.md) (Engineering practices)
- [Performance engineering](https://swe.quest/tags/performance.md) (Reliability & operations)
- [Deployment](https://swe.quest/tags/deployment.md) (Reliability & operations)

## Prerequisites

- Git merge and rebase

## Keywords

merge-ort, git-replay, libgit2, Scientist, Git, merge-recursive

## Related posts

- [Optimizing Git’s Merge Machinery, #3](https://swe.quest/articles/optimizing-git-s-merge-machinery-3-2b68eed913acded5.md): Palantir · 2021-04-09 · Hard · 11 min read · Version control, Performance engineering, Algorithms, Open source
  Git's merge machinery can skip rename detection for source files whose renames cannot change the merge result: files unmodified on the unrenamed side of history, and files not needed for directory rename detection's majority rule.
- [Improving Git push times through faster server side hooks](https://swe.quest/articles/improving-git-push-times-through-faster-server-side-hooks-21ad6ccb34bf4962.md): GitHub Engineering · 2022-04-21 · Medium · 5 min read · Performance engineering, Version control, Go, Ruby, Refactoring & migrations
  GitHub cut pre-receive hook execution time on every Git push from about 880ms median to 10ms, dropping P99 by 95%, by rewriting the hooks from Ruby into its Go Git service.
- [20× the CI traffic without getting slower: How we rebuilt Git serving at Datadog](https://swe.quest/articles/20-the-ci-traffic-without-getting-slower-how-we-rebuilt-git-serving-at-datadog-9f7156670a81ca53.md): Datadog Engineering · 2026-08-19 · Medium · 13 min read · Version control, CI/CD, Scaling, Caching, Replication
  Datadog replaced CI fetches from a replicated Gitaly/Praefect cluster with gitretriever, a fleet of independent Git mirrors that poll GitHub per changed ref and fan packfiles out to autoscaled relays over a gRPC signaling stream plus HTTP.
- [Improve Git monorepo performance with a file system monitor](https://swe.quest/articles/improve-git-monorepo-performance-with-a-file-system-monitor-1e7445f19bf20b0e.md): GitHub Engineering · 2022-06-29 · Medium · 22 min read · Version control, Performance engineering, Developer tools
  Git 2.37.0 adds a builtin file system monitor daemon (\`git fsmonitor--daemon\`) for macOS and Windows, enabled by setting \`core.fsmonitor\` to true.
- [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.

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)
