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

Your large repo was fast after `git maintenance start`, but months later it is slow again and no maintenance seems to run.

IntermediateTroubleshootingRepository Health, Size and Performance
Answer

Likely causes → The scheduler entry is gone (new laptop, OS reinstall, cron/launchd/systemd timer removed), the repo moved to a new path so maintenance.repo points at the old one, or the repo was never registered on this machine.

Diagnose →

git config --global --get-all maintenance.repo
crontab -l | grep 'git for-each-repo'                     # Linux cron
systemctl --user list-timers | grep git-maintenance       # systemd scheduler

Fix →

git config --global --unset-all maintenance.repo /old/path/app
cd /new/path/app && git maintenance register
git maintenance start
git maintenance run --task=gc       # catch up once now

Prevent → Include git maintenance start in the machine bootstrap script, and re-register after moving repos.

All Git & GitHub questions Roadmap: Git & GitHub

More on Repository Health, Size and Performance