Use of git lfs clone

Daniel Russel's Avatar

Daniel Russel

12 Sep, 2016 10:51 PM

The clone phase of our repo takes quite a while due to lfs files. Using `git lfs clone` is supposed to make this a lot faster, but there does not seem to be a way to do this in appveyor. Is there some way to do this? If not, it would be nice to have it done by default (as I think it is harmless) or at least as an option. Thanks.

  1. Support Staff 1 Posted by Feodor Fitsner on 14 Sep, 2016 02:27 AM

    Feodor Fitsner's Avatar

    Hi Daniel,

    AppVeyor allows you to override cloning code with your own snippet (clone_script in appveyor.yml). You can modify this example to suite your needs:

  2. 2 Posted by Daniel Russel on 14 Sep, 2016 04:09 PM

    Daniel Russel's Avatar

    Thanks very much. I ended up with the following as the lfs version on appveyor (1.2) is too old to support lfs clone with –depth (1.4 does).

    - ps: >-
        if(-not $env:appveyor_pull_request_number) {

          git clone --depth=1 -q -c filter.lfs.smudge= -c filter.lfs.required=false --branch=$env:appveyor_repo_branch$env:appveyor_repo_name.git $env:appveyor_build_folder

          git checkout -qf $env:appveyor_repo_commit

          git lfs pull

        } else {

          git clone --depth=1 -q -c filter.lfs.smudge= -c filter.lfs.required=false$env:appveyor_repo_name.git $env:appveyor_build_folder

          git fetch -q origin +refs/pull/$env:appveyor_pull_request_number/merge:

          git checkout -qf FETCH_HEAD

          git lfs pull

  3. Support Staff 3 Posted by Feodor Fitsner on 14 Sep, 2016 08:36 PM

    Feodor Fitsner's Avatar

    Thank you for sharing the final solution, I've saved it here:

    We'll deploy Git LFS 1.4.1 during the next update. Issue to watch:

  4. Ilya Finkelshteyn closed this discussion on 25 Aug, 2018 02:08 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts


? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac