Why can `git pull` on a large monorepo be slow and how do you mitigate it?
AdvancedConceptGitHub features, history rewriting and scale
Answer
Fetch computes and transfers many objects, then merge or checkout touches many files. Use --filter=blob:none, shallow-for-CI, fetch.negotiationAlgorithm=skipping, background prefetch via maintenance, sparse checkout and fsmonitor, and avoid full --all fetches.
git config fetch.negotiationAlgorithm skipping
git config feature.manyFiles true
More on GitHub features, history rewriting and scale
What does a GitHub Actions workflow look like at a basic level?BeginnerWhat are GitHub environments and what protection do they offer?IntermediateWhat is a GitHub Release and how does it relate to a Git tag?BeginnerWhat are the permissions of `GITHUB_TOKEN` and how do you restrict them?IntermediateWhy do fork PRs get no secrets, and what is `pull_request_target`?AdvancedWhat is the difference between a GitHub fork and a clone?Beginner