Interview Prep/Git & GitHub/Scale, Submodules, LFS and GitHub Automation

A huge repo makes `git status` and `git log` slow. What do you tune?

AdvancedScenarioScale, Submodules, LFS and GitHub Automation
Answer

Situation read → Large trees and many packfiles slow down core commands.

What I'd do →

  1. Enable background maintenance: git maintenance start.
  2. Write the commit graph: git commit-graph write --reachable --changed-paths.
  3. Turn on core.fsmonitor=true and core.untrackedCache=true; consider feature.manyFiles=true.
  4. Repack and tune: git repack -adf --depth=50 --window=250; check with git count-objects -vH.
  5. Diagnose hot spots with GIT_TRACE2_PERF=1 git status.

Why → Commit-graph and fsmonitor avoid walking everything each time.

Interview tip → Measure first with GIT_TRACE2_PERF, then tune.

All Git & GitHub questions Roadmap: Git & GitHub

More on Scale, Submodules, LFS and GitHub Automation