Scaling Git’s garbage collection
Sep 13, 2022Taylor Blau

Summary
This post details the engineering challenges and solutions for scaling Git's garbage collection at GitHub. It explains object reachability, the race condition in object deletion during pushes, and how Git's `--prune=<date>` flag mitigates this by using object mtimes. The post highlights the problem of storing many loose unreachable objects and introduces the concept and implementation of 'cruft packs' to store unreachable objects in a pack while retaining their individual mtime data. These improvements were contributed upstream to Git.