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

The CI "Checkout" step takes 5–6 minutes on every run.

BeginnerTroubleshootingRepository Health, Size and Performance
Answer

Likely causes → The job clones full history and all branches/tags (fetch-depth: 0), pulls LFS objects or submodules it does not need, or the repo is simply large.

Diagnose → Check the checkout step options and the clone size: git count-objects -vH in a debug step.

Fix → Fetch only what the job needs:

- uses: actions/checkout@v4
  with:
    fetch-depth: 1          # default; use 0 only for versioning jobs
    lfs: false
    submodules: false
    sparse-checkout: |
      services/api
      shared

For huge repos use filter: blob:none, or a persistent runner with a reference mirror.

Prevent → Review checkout settings per job; only release/versioning jobs need full history.

All Git & GitHub questions Roadmap: Git & GitHub

More on Repository Health, Size and Performance