Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GitLab CI sparse checkout?

Tags:

git

gitlab-ci

Is it possible to configure the GitLab CI to only perform a sparse checkout? I have inherited a large codebase, most of which I can ignore when running the CI. If I can't do a sparse checkout, is there anything to be gained by setting the GIT_CLEAN_FLAGS to perhaps discard directories that I don't care about?

like image 251
Paul D Smith Avatar asked Oct 23 '25 16:10

Paul D Smith


1 Answers

Sounds like a good case for breaking up the repository.

Git clean would not help as the files you want to remove are version controlled so git clean acts on untracked files only and would not remove them.

You could try setting the GIT_STRATEGY variable to none to prevent gitlab from cloning the repository and then performing the checkout yourself using a sparse checkout in your job script.

variables:
  GIT_STRATEGY: none
like image 192
Glen Thomas Avatar answered Oct 26 '25 07:10

Glen Thomas