Interview Prep/CI/CD/Metrics, Performance and Cost

What is the effect of Git clone size and strategy on CI time, and how do you reduce it?

BeginnerProductionMetrics, Performance and Cost
Answer

Cloning large histories can take minutes. Use shallow clones (fetch-depth: 1 or GIT_DEPTH), partial clone (--filter=blob:none), sparse checkout for monorepos, local reference mirrors on persistent agents, and git fetch into a reused workspace on static agents. Remember that tools needing history (changelogs, SonarQube blame, git describe) need a deeper fetch, so make it explicit in those jobs only.

git clone --depth 1 --filter=blob:none --sparse https://github.com/acme/monorepo.git
git sparse-checkout set services/payments
All CI/CD questions

More on Metrics, Performance and Cost