Guides
How to make git checkout faster
actions/checkout takes minutes on a large repository.
4 min read
actions/checkout takes minutes on a large repository.
Why it happens
The default fetches full history for the branch, and large repositories with many objects are slow to clone.
How to fix it
- Use fetch-depth: 1 unless you specifically need history
- Enable sparse checkout for monorepos where a job only touches one directory
- Use filter: blob:none for a partial clone that fetches blobs on demand
- Remember that affected-target detection needs fetch-depth: 0 — do not blanket-shallow everything
Your next build could be twice as fast, at half the price
Start free. Migrating away is the same one line, and we publish that diff too.
Related
How to speed up GitHub ActionsYour pipeline takes longer than anyone wants to wait, and it is not obvious where the time goes.How to find the slow step in a workflowThe pipeline is slow but every individual step looks reasonable.How to reduce GitHub Actions cold startsJobs sit for 30 to 90 seconds before the first step runs.How to diagnose GitHub Actions queue timesJobs are queued for minutes before a runner picks them up.