Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-59516

There is no way to pull LFS files for submodules in GIT

      As far as I can tell, there is no way to checkout LFS files for git submodules using the Source Code Management tab of the configure screen. This means that I am currently unable to build projects with jenkins that are dependent on a git project with submodules that have LFS files.

          [JENKINS-59516] There is no way to pull LFS files for submodules in GIT

          Lucas Vander Wal created issue -
          Lucas Vander Wal made changes -
          Labels Original: git git-lfs New: git git-lfs git-submodule

          Lucas Vander Wal added a comment - See  https://stackoverflow.com/q/58085269/6322589
          Mark Waite made changes -
          Assignee Original: Mark Waite [ markewaite ]
          Mark Waite made changes -
          Issue Type Original: Bug [ 1 ] New: Improvement [ 4 ]
          René Scheibe made changes -
          Link New: This issue relates to JENKINS-56569 [ JENKINS-56569 ]

          René Scheibe added a comment -

          I think currently the only option to handle this is outside of the job configuration.

          Many git LFS installers automatically set up a global or system wide "lfs" filter as follows:

          [filter "lfs"]
              clean = git-lfs clean -- %f
              smudge = git-lfs smudge -- %f
              process = git-lfs filter-process
              required = true 

          A configuration like this on a Jenkins agent would fetch all LFS files (even without the "Git LFS pull after checkout" behaviour configured on a Jenkins job).

          René Scheibe added a comment - I think currently the only option to handle this is outside of the job configuration. Many git LFS installers automatically set up a global or system wide "lfs" filter as follows: [filter "lfs" ] clean = git-lfs clean -- %f smudge = git-lfs smudge -- %f process = git-lfs filter-process required = true A configuration like this on a Jenkins agent would fetch all LFS files (even without the "Git LFS pull after checkout" behaviour configured on a Jenkins job).

          Ian Panzer added a comment -

          I have hit this issue and i's going to take a fair bit of work to get around. Allowing a Git LFS pull to happen during the submodule checkout would be awesome.

          Ian Panzer added a comment - I have hit this issue and i's going to take a fair bit of work to get around. Allowing a Git LFS pull to happen during the submodule checkout would be awesome.

          I've also came accross this today. Unfortunately, its a nasty issue. However, I did write a workaround. After doing the checkout, I run a follow-up git pull on the submodules:

          sshagent(credentials: ['my-ssh-key-id']) {
              sh 'GIT_SSH_COMMAND="ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no" git submodule foreach git lfs pull'
          }

          This helps me move forward for the time being.

          Bogomil Vasilev added a comment - I've also came accross this today. Unfortunately, its a nasty issue. However, I did write a workaround. After doing the checkout, I run a follow-up git pull on the submodules: sshagent(credentials: [ 'my-ssh-key-id' ]) { sh 'GIT_SSH_COMMAND= "ssh -o UserKnownHostsFile=/dev/ null -o StrictHostKeyChecking=no" git submodule foreach git lfs pull' } This helps me move forward for the time being.

          Mark Waite added a comment -

          smirky that work around or the workaround using the

          withCredentials { }

          block as described in the git plugin documentation are the preferred technique. I don't intend to add this capability to the git plugin submodule support.

          Mark Waite added a comment - smirky that work around or the workaround using the withCredentials { } block as described in the git plugin documentation are the preferred technique. I don't intend to add this capability to the git plugin submodule support.

            Unassigned Unassigned
            lucasvw Lucas Vander Wal
            Votes:
            4 Vote for this issue
            Watchers:
            9 Start watching this issue

              Created:
              Updated:
              Resolved: