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.
More on Repository Health, Size and Performance
`git status` takes 8–15 seconds in a large monorepo.Intermediate`error: The last gc run reported the following. Please correct the root cause and remove .git/gc.log` followed by `warning: There are too many unreachable loose objects; run 'git prune' to remove them.`IntermediateEvery few commands Git prints `Auto packing the repository in background for optimum performance.` and the machine stutters.BeginnerA fresh clone downloads 4 GB, but the checked-out files are only 200 MB.Intermediate`git gc` or `git clone` dies with `fatal: Out of memory, malloc failed (tried to allocate 1073741824 bytes)` or `error: pack-objects died of signal 9`.Advanced`error: unable to create temporary file: No space left on device` followed by `fatal: failed to write object`.Beginner