git

Speed Up a Pipeline by Using a Git Shallow Clone

4 minute read Published: 2022-05-25

When you are working with a big repository that contains a lot of commits, the CI system can take a lot of time fetching the repo. And often, you don't need the whole history to run the test suits.

By default, Gitlab do a shallow clone, and fetch only the latest 50 commit, but this can be configured globally or per job by adding a GIT_DEPTH variables.