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: https://gist.github.com/FeodorFitsner/99d5ba9b6171063804f9db08534becb2

  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).

    clone_script:
    - 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 git@github.com:$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 git@github.com:$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: https://gist.github.com/FeodorFitsner/536a24c11e509c95aa7b0ba7e4b19408

    We'll deploy Git LFS 1.4.1 during the next update. Issue to watch: https://github.com/appveyor/ci/issues/1042

  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

Generic

? 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

Recent Discussions

18 Jan, 2020 11:37 AM
18 Jan, 2020 05:35 AM
18 Jan, 2020 02:13 AM
18 Jan, 2020 12:16 AM
17 Jan, 2020 11:13 PM