Interview Prep/Git & GitHub/Repository Health, Size and Performance

Every few commands Git prints `Auto packing the repository in background for optimum performance.` and the machine stutters.

BeginnerTroubleshootingRepository Health, Size and Performance
Answer

Likely causes → More than gc.auto (6700) loose objects or more than gc.autoPackLimit (50) packs exist, so Git keeps triggering auto-gc. If gc never finishes (killed laptop lid, CI container exits), it starts again next time.

Diagnose → git count-objects -v (look at count and packs).

Fix → Run one full gc in the foreground and let it finish: git gc. On CI runners where gc is pointless, disable it: git config --global gc.auto 0. For long-lived dev clones, prefer scheduled maintenance: git maintenance start.

Prevent → Do not kill Git processes mid-gc; let scheduled maintenance do the work instead of auto-gc.

All Git & GitHub questions Roadmap: Git & GitHub

More on Repository Health, Size and Performance