Git 2.42 Released: Faster Reference Handling and Preserving Precious Objects
Git 2.42 added a faster boundary-based bitmap traversal, reference jump lists for excluding references efficiently, and a hook to protect precious unreachable objects from garbage collection.
Historical Archive. This article documents an event from 2023 and is preserved with its original date for reference. It is not current news, and details may have changed since publication.
What happened
Git 2.42 was released on August 21, 2023, per the GitHub blog's Highlights from Git series, with features and fixes from more than 78 contributors. The release focused on performance for large repositories and on giving operators finer control over garbage collection.
Faster reachability and reference handling
Git 2.42 introduced a new boundary-based variant of its bitmap traversal algorithm that often outperforms the previous implementation, especially when reachability-bitmap coverage is sparse, with real-world improvements observed between two and fifteen-fold. The release also added a way to exclude references by pattern in git for-each-ref via a new --exclude option, building a jump list so Git can skip whole regions of excluded references at once instead of inspecting them one by one, which can provide a large speed-up when advertising references during pushes.
Preserving precious objects
Building on the cruft-packs mechanism for tracking unreachable objects, Git 2.42 added a new gc.recentObjectsHook configuration. It lets operators point Git at external programs that print object IDs which should be immune from pruning, regardless of age. This makes it possible to retain a large set of unreachable-but-precious objects, for example tracked in an external database, without having to create a reference for each one.
Why it mattered
For hosting providers and anyone running very large repositories, Git 2.42's traversal and reference-exclusion improvements translated directly into faster pushes and fetches. The precious-objects hook gave operators a practical tool for retaining important unreachable objects, addressing a real operational need around garbage collection at scale.
Related on Skillo
See also: Git 2.39 and its garbage-collection improvements, Git 2.45's reftable and SHA-256 work.
Sources
Published date reflects the original event date (2023-08-21). This article is original Skillo editorial written from the sources above; facts were verified in September 2026.
Written by
Skillo Staff
0 Comments
Sign in to join the discussion.
No comments yet. Be the first to share your thoughts.