Interview Prep/Git & GitHub/Monorepos, large files and repository performance

What causes slow fetches and how do you diagnose them on the server side?

AdvancedProductionMonorepos, large files and repository performance
Answer

Typical causes: too many refs (thousands of stale PR/branch refs), no reachability bitmaps, many small packs, and lack of a commit-graph. Delete stale refs, enable bitmaps and multi-pack-index with scheduled repack, and use protocol v2. Check by tracing packet exchange.

GIT_TRACE_PACKET=1 GIT_TRACE_PERFORMANCE=1 git fetch origin 2>&1 | head -50
git for-each-ref | wc -l
All Git & GitHub questions Roadmap: Git & GitHub

More on Monorepos, large files and repository performance