Git 2.55 Ships Smarter Repacking That Makes Huge Repos 2x Faster

Git 2.55 ships incremental MIDX repacking, a new git history fixup command, Linux fsmonitor support, and a raft of performance improvements

·
·
·
Git 2.55 Ships Smarter Repacking That Makes Huge Repos 2x Faster
Read7 min
TypeNews
SubtopicCode Review
  • Incremental MIDX repacking: git repack --write-midx=incremental --geometric=2 keeps MIDX layer count logarithmic, avoiding full rewrites on large repos.
  • git history fixup: New subcommand folds staged changes into an earlier commit in one step, replacing the two-step fixup+rebase flow.
  • Linux fsmonitor: Built-in filesystem monitor daemon now works on Linux via inotify, making git status near-instant on large repos.
  • Bitmap generation ~2x faster: Large-repo benchmark dropped from 612s to 294s; pseudo-merge bitmaps now add far less overhead.
  • Push to remote groups: git push <group> now works like git fetch groups, simplifying multi-mirror workflows.
  • Sideband security: Terminal control sequences from remote servers are now masked by default, closing a subtle injection vector.

Git 2.55 is out, and it is one of the more infrastructure-heavy releases in recent memory. With contributions from over 100 people (33 of them first-timers), the release focuses on making large repositories cheaper to maintain, history editing more intuitive, and a handful of long-standing paper cuts finally get fixed. Here is what matters most.

The big one: smarter repacking for large repos

The headline feature is a new incremental repacking strategy built on top of multi-pack indexes (MIDX). To understand why this matters, a quick primer: Git stores your repo's content as objects (commits, trees, blobs) bundled into compressed packfiles. A MIDX is a single index over many packfiles, so Git can find any object without scanning every pack individually. For large repos receiving constant pushes, this is a critical performance tool.

The problem with a classic single-file MIDX is that even a tiny update forces a full rewrite of the entire index. Incremental MIDXs address that by storing a chain of MIDX layers. Each layer covers some collection of packs, and the chain file records the order of those layers. Appending a new layer to the tip of the chain does not invalidate the older layers, so Git can index newly created packs without rewriting a single MIDX that covers the entire repository.

Git 2.55 teaches git repack how to write those incremental MIDX chains directly:

code
$ git repack --write-midx=incremental
$ git repack --write-midx=incremental --geometric=2 -d

When those modes are used together, each repack creates a new tip layer, then decides whether adjacent layers should be compacted together. The default rule is controlled by repack.midxSplitFactor: if the accumulated object count in newer layers grows large enough relative to the next older layer, Git merges those layers into a single replacement layer.

Chain of MIDX layers with pack sizes, showing how newly written packs sit outside the existing chain

The algorithm is elegant: it keeps the number of MIDX layers logarithmic in the total number of objects. The result is a compromise between two extremes. A single-file MIDX minimizes lookup complexity, but can require large rewrites during maintenance. A purely append-only incremental MIDX minimizes each write but allows the chain to grow without bound. Geometric incremental repacking keeps the number of layers logarithmic in the total number of objects, while ensuring that the newest, smallest layers are rewritten more often than older, larger ones.

For repositories that receive a steady stream of new objects, this means routine maintenance can update the repository's pack metadata incrementally, without forcing each maintenance run to rewrite a single MIDX covering the entire object store. This is exactly the kind of maintenance strategy GitHub itself uses at scale.

History editing gets a friendlier face

The second major feature builds on the experimental git history command introduced in Git 2.54. The new fixup subcommand solves a workflow almost every developer has hit: you realize a staged change belongs in an earlier commit, not at the branch tip.

Previously, the idiomatic approach was:

code
$ git commit --fixup=<commit>
$ git rebase --autosquash <commit>^

Git 2.55 builds on the experimental git history command by adding a new fixup subcommand. It applies the changes currently staged in the index to an earlier commit. One command instead of two, and you express what you want, not how to do it:

code
$ git history fixup <commit>

The target commit keeps its message and authorship by default, unless you pass --reedit-message, and Git rewrites the commits that follow so the branch ends at an equivalent history with the fix in the right place. Like the rest of git history, this command is still experimental. It is also intentionally conservative. Because fixup reads from the index, it needs a working tree and cannot operate in a bare repository; if applying the staged change would produce a conflict, the command aborts instead of leaving you in the middle of a stateful rewrite.

Everything else worth knowing

Beyond the two headliners, Git 2.55 ships a dense set of improvements:

  • Linux fsmonitor support: Until now, the built-in filesystem monitor daemon was available only on macOS and Windows. Git 2.55 adds support for Linux, where the implementation uses inotify. That works without elevated privileges, but requires one watch per directory, so very large repositories may need to raise the fs.inotify.max_user_watches limit. This means git status can now be near-instant on Linux for large repos, not just Mac and Windows.
  • Bitmap generation ~2x faster: In benchmarks from the patch series, those general improvements reduced bitmap generation time in one large repository from about 612 seconds to about 294 seconds. Reachability bitmaps are the data structure Git uses to answer "which objects are reachable from this commit?" without walking the full object graph.
  • Pseudo-merge bitmaps no longer hurt generation time: In one benchmark, pseudo-merges made a full git rev-list --objects --use-bitmap-index traversal nearly 20 times faster, but previously nearly doubled bitmap generation time. After these changes, pseudo-merges keep most of their traversal speedup while adding much less work to the bitmap generation path.
  • Smaller packs with --path-walk + filters: In Git 2.55, --path-walk can be combined with filters including blob:none, blob:limit=<n>, tree:0, and others, making packing using --path-walk available in more partial-clone and filtered-pack workflows. In one benchmark on Git's own repository, a blob-less path-walk repack produced a pack roughly 16% smaller, at the cost of a slower fresh-delta computation.
  • Parallel config-based hooks: Git 2.55 extends config-based hooks by allowing compatible configured hooks to run in parallel. For example, a project might have independent pre-commit hooks for linting and unit tests; if both declare hook.<name>.parallel = true, Git can run them at the same time.
  • Push to remote groups: Git 2.55 lets git push use remote group shorthand. This is equivalent to pushing to each remote in the group in sequence. Useful for mirroring workflows:
    code
    $ git config remotes.publish "github gitlab mirror"
    $ git push publish main
  • Sideband security hardening: Before Git 2.55, a server could include arbitrary terminal control sequences in sideband output, including sequences that move the cursor or erase text. Git now masks most of those control characters by default while still allowing ANSI color sequences, so colored progress output continues to work.
  • --max-count-oldest=<n>: Git 2.55 adds a new --max-count-oldest=<n> option to git rev-list and the git log family of commands, which selects the oldest n commits in a range instead. No more shell pipeline hacks to get the oldest N commits.
  • --graph-lane-limit=<n>: Git 2.55 adds --graph-lane-limit=<n> to git log --graph and related commands. Lanes beyond the limit are replaced with ~, making graph output more manageable in repositories with very wide histories.
MIDX layer compaction diagram showing how adjacent layers are merged based on relative object counts

Who should care, and how to get it

Git 2.55 is free and open source, as always. You can grab it from the official release notes or your package manager of choice. Most of the biggest wins here are invisible to everyday users but significant for teams running large monorepos or hosting infrastructure at scale. The incremental MIDX repacking and bitmap speedups are the kind of changes that make a real difference when your repo has millions of objects and thousands of daily pushes.

For individual developers, the practical wins are git history fixup for cleaner history editing, Linux fsmonitor for faster git status, and the new --max-count-oldest flag for a long-standing ergonomic gap. The full GitHub highlights post covers additional details on each change.

Trending
  • No trending articles

Comments

avatar

Next Reads