AI Briefing
Sign in

Git 2.56 Released with Safer Conflict Staging and Faster Merge Base Calculation

·2026.09.29 02:23

Key point

The release includes a new git add --resolved command to prevent staging unrelated changes and optimizations that reduced merge-base traversal time from 0.68 seconds to 0.01 seconds in large monorepos.

Details

The Git project has released Git 2.56.0, featuring contributions from over 104 developers, including 39 new contributors. The update focuses on improving safety during merge conflict resolution, accelerating common ancestor calculations, and enhancing repository maintenance tools.

Safer Conflict Resolution

Git 2.56 introduces git add --resolved, a new mode designed to stage only paths currently unmerged in the index. Unlike git add -u, which stages all modified tracked files, this command scans unmerged regular files for leftover conflict markers before staging. If markers are found, Git reports the affected paths and leaves the index unchanged, preventing the accidental staging of unresolved conflicts or unrelated local edits. This mode cannot be combined with -u or -A and ignores files that were never conflicted.

Faster Merge Base Calculation

The release optimizes the algorithm for finding common ancestors, a critical operation for merges and pull request diffs. Git now tracks how many queued commits remain painted exclusively by each side, allowing it to stop traversal once one side is exhausted. This change yields significant performance gains in large repositories:

  • In one real monorepo case, traversal time fell from 0.68 seconds to 0.01 seconds.
  • Production evaluations on two large monorepos showed improvements of approximately 70 times faster in one and an average of 20 times faster in the other.
  • For the Linux kernel, git merge-base --all v4.8 v4.9 improved from 167,441 traversal steps and 0.29 seconds to 3,887 steps and 0.01 seconds.

Path-Walk Repacking Improvements

Git 2.56 removes previous restrictions on path-walk repacking, making it more viable for large repository hosts. Path-walk repacking groups objects by tree location to find better delta relationships, which can reduce pack size by about 71% (e.g., from 558.5 MB to 164.4 MB in a Fluent UI benchmark). The update allows path-walk repacks to:

  • Select commits for new reachability bitmaps, enabling fast object enumeration.
  • Perform bookkeeping for delta islands, preserving isolation rules between ref groups.

These changes do not enable path-walk by default but remove key adoption blockers for hosts seeking storage savings without sacrificing serving performance.

Additional Features and Fixes

  • git history drop: An experimental command that removes a selected commit and replays its descendants, aborting if conflicts or local changes would be overwritten.
  • git refs toolbox: Consolidates low-level reference management commands like create, update, delete, and rename under a single interface.
  • Bulk branch cleanup: git branch --delete-merged now supports glob patterns (e.g., origin/*) and --dry-run to safely identify and delete merged local topic branches.
  • git bisect --reset-when-found: Automatically resets the working tree to the original state or the found commit after bisection completes.
  • Partial clone cleanup: git repack can now discard large, recoverable blobs locally using --drop-filtered, relying on the promisor remote to fetch them again when needed.
  • Performance fixes: Removed quadratic scans in reftable writes and path-limited diffs, reducing operations on large repositories (e.g., Chromium checkout) from minutes to seconds.

This summary was generated automatically by AI. Check the original for the author's claims and context. Copyright belongs to the original author.

Our guide explains how the AI works. Report summary errors, attribution issues, or removal requests via Contact.