Brifing

Key Features in Git 2.56 Release

Safer conflict resolution, faster merge-base calculations, and improved repacking for large repositories

The GitHub Blog3 min

1Safer conflict resolution workflow

Git 2.56 introduces git add --resolved specifically for staging resolved merge conflicts while avoiding accidental staging of unrelated changes. The command checks for remaining conflict markers before staging and only considers currently unmerged paths. This prevents common workflow mistakes where git add -u could stage unrelated local changes or files still containing conflict markers during merge resolution.

2Optimized merge-base calculation

The new version dramatically improves performance when finding common ancestors between commits. By tracking remaining exclusive commits during traversal, Git can stop earlier when no new merge bases are possible. Real-world tests show improvements up to 70x faster in large monorepos. The Linux kernel case saw reduction from 167,441 traversal steps to just 3,887 steps, dropping execution time from 0.29s to 0.01s.

3Path-walk repacking enhancements

Git 2.56 removes two major blockers for path-walk repacking adoption in server environments. It now supports both reachability bitmaps and delta islands, enabling storage savings without sacrificing query performance. Benchmarks show path-walk repacks producing packs 71% smaller than traditional methods (164.4MB vs 558.5MB in Fluent UI repository tests). These changes allow large hosts to evaluate storage optimizations while maintaining existing performance guarantees.

4Experimental git history commands

The git history experimental feature gains drop capability in version 2.56, allowing removal of specific commits while replaying descendants onto parents. The command preserves unrelated local changes and aborts if conflicts would occur. Currently limited to linear histories without merge commits, this continues Git's exploration of more powerful history manipulation tools beyond traditional rebase workflows.

5Ref management consolidation

Version 2.56 introduces git refs toolbox, centralizing low-level reference operations previously scattered across multiple commands. The new subcommands (create, update, delete, rename) provide consistent CAS protection through optional old-value parameters. While deliberately low-level (not handling branch configuration like git branch -m), this standardization improves plumbing consistency for script and tool authors.

6Bulk branch cleanup

Git 2.56 adds git branch --delete-merged for bulk removal of local branches whose work has landed upstream. The command supports pattern matching for both upstream references (origin/*) and local branch names (topic-*), with --dry-run for previewing changes. Protected cases include checked-out branches, missing upstreams, and ambiguous push configurations, with branch.deleteMerged setting offering additional protection.

7Bisect automation improvements

The git bisect run command gains --reset-when-found option to automatically handle post-bisection cleanup. Users can specify returning to original commit (default) or staying on found culprit, eliminating the manual git bisect reset step. This enhancement maintains bisect's powerful regression-finding capability while streamlining the complete workflow.

8Partial clone optimizations

Version 2.56 introduces manual cleanup for partial clones through git repack --filter --drop-filtered. This allows discarding large, recoverable blobs that were previously stored permanently after on-demand fetch. Currently limited to blob:limit filters and requiring promisor remote, this GSoC contribution helps manage local storage for workflows using partial cloning.

9Improved path tracking

git log --follow now handles path tracking through non-linear history more reliably by maintaining separate path records per parent. This fixes cases like subtree merges where traversal order previously affected results. The change makes rename tracking deterministic regardless of commit graph traversal sequence.

10Performance optimizations

Multiple internal changes address scaling cliffs in Git 2.56. Reftable writes avoid redundant reloads, packfile loading eliminates O(N²) regression, and path-limited diffs remove quadratic scans. Real-world improvements include reducing a prompt-related command from 4.5s to constant time in repos with 37,815 packs, and cutting a Chromium checkout diff from 8 minutes to 0.07s for operations with ~500,000 index entries.

Original article: The GitHub Blog — Key Features in Git 2.56 Release