Maximilian Schulz
Maximilian Schulz

Reputation: 452

Disabling GIT LFS for GitLab CI

How can configure the GitLab CI runners to clone without downloading the LFS files? Those files are not needed for the tests and it would speed up our development workflow significantly. Any help is very much appreciated!

I have only encountered the same question on reddit: link with unfortunately no useful answers. Note that I also posed the question the gitlab forum two months ago (link) with no luck so far.

Upvotes: 9

Views: 4302

Answers (1)

Nils Werner
Nils Werner

Reputation: 36765

You can try setting the variable GIT_LFS_SKIP_SMUDGE=1

variables:
  GIT_LFS_SKIP_SMUDGE: "1"

or take control over the git checkout call, and set lfs.fetchexclude beforehand

variables:
  GIT_STRATEGY: clone
  GIT_CHECKOUT: "false"
script:
  - git config lfs.fetchexclude "*"
  - git checkout $CI_COMMIT_REF_NAME

Upvotes: 18

Related Questions