Supercharge your Git workflows Note
GitLab

Supercharge your Git workflows

Developers working with large Git repositories, like Chromium, face significant productivity issues due to lengthy clone times, often exceeding 90 minutes. This impacts CI/CD pipelines, increases infrastructure costs, and frustrates developers. The "Git Much Faster" script offers a solution by benchmarking and applying optimization techniques to drastically reduce clone times. It addresses Git's default speed-over-safety approach, which becomes a bottleneck with large codebases, binary assets, or monorepos. The script compares standard clones, optimized configurations, and Git's Scalar tool. Key optimizations include disabling compression, increasing HTTP buffer sizes, and utilizing shallow and partial clones. Sparse checkout further refines this by excluding unnecessary binary files. Real-world benchmarks show dramatic improvements, with Chromium clones reduced from 95 minutes to just over 6 minutes. The custom optimized approach consistently outperforms Git's Scalar tool in speed and efficiency. Implementation can start with read-only optimizations in CI/CD, gradually expanding to development workflows. These optimizations reduce load on the entire system, from client to storage, making workflows faster and cheaper.