6

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.

  • Have you tried [setting the variablee `GIT_LFS_SKIP_SMUDGE=1`](https://docs.gitlab.com/ee/ci/yaml/#variables)? – Nils Werner Aug 14 '18 at 14:28
  • Possible duplicate of [How to clone/pull a git repository, ignoring LFS?](https://stackoverflow.com/questions/42019529/how-to-clone-pull-a-git-repository-ignoring-lfs) – phd Aug 14 '18 at 18:55
  • I don't think it's a duplicate, as its specific to GitLab CI – Maximilian Schulz Aug 28 '18 at 18:01

1 Answers1

13

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
Josh Correia
  • 3,807
  • 3
  • 33
  • 50
Nils Werner
  • 34,832
  • 7
  • 76
  • 98