Git looks like a version-control tool. It is also a content-addressed database, a filesystem cache, a graph walker, and a transfer protocol.
This book is about those layers and the performance costs of each one. It starts with objects, refs, the index, and history traversal, then moves outward into packfiles, maintenance, sparse working trees, partial clone, transport, repository scale, diagnosis, configuration, and recovery.
It is written for engineers who need Git to stay fast as repositories, histories, and teams get larger: build and CI engineers, monorepo owners, developer-experience teams, and the people who wind up debugging strange Git behavior when the easy explanations stop working.
Section 0 · Introduction
- Introduction
Section I · Foundations
Why Git gets slow, what Git stores, and how refs and the index steer through it.
- Why Git Performance Matters
- Git's Core Data Model
- Refs, HEAD, Reflogs, Index
Section II · History and Rewrite
How Git walks history and how rewrite commands reshape it without mutating commits.
- Revisions and History Traversal
- Merge, Rebase, Cherry-Pick, Rewrite
Section III · Storage and Local Scale
Object storage, index cost, maintenance, and the techniques that shrink local state.
- Loose Objects, Packfiles, Delta Compression
- The Index as a Performance Structure
- Commit-Graph, Bloom Filters, MIDX, Bitmaps
- Git GC and Maintenance
- Sparse-Checkout and Sparse-Index
Section IV · Large-Repo Operations, Transport, and Scale
Clone shape, transfer policy, parallel work with worktrees, repository size, and ref scale.
- Partial Clone and Promisor Remotes
- Scalar, Prefetch, Large Repositories
- Worktrees
- Clone, Fetch, Push, Protocol v2
- Bundles and Bundle URIs
- Reducing Repository Size
- Large Ref Sets: Files, Packed-Refs, Reftable, and
git refs
Section V · Diagnosis and Recovery
How to instrument Git, find the slow layer, apply high-leverage settings, and recover when the repository is actually wrong.
- Instrumenting Git
- Finding and Fixing Slow Git
- Configuration Playbook
- Recovery and Repair
Back Matter
- Epilogue: Git in the Agent Loop
- Appendix: Compatibility Guidance
- Appendix: Approaches to Virtualized Working Trees
- Glossary of Git Terms