4

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

7

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_BUILD_REF_NAME
Nils Werner
  • 28,291
  • 6
  • 62
  • 82
  • Thank you! So I tried to set the variable and in principle, it works, but only with `GIT_LFS_SKIP_SMUDGE: "1"`, with the proposed solution, Gitlab CI gives me the error `FATAL: invalid value for variable "GIT_LFS_SKIP_SMUDGE"`. – Maximilian Schulz Aug 28 '18 at 18:00
  • 1
    Thanks for the feedback, I have adjusted my post. – Nils Werner Aug 28 '18 at 19:14