question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Why do I have to pull the lfs separately when using lfs: 'true'

See original GitHub issue
                  - name: checkout
                    uses: actions/checkout@v2
                    with:
                        lfs: 'true'
                  - name: checkoutLFS
                    uses: actions/checkout@v2
                  - run: git lfs pull

With only the first of those, the source checkout has LFS which look like this:

-rw-r--r-- 1 runner docker 133 Jun 1 15:54 largefile.zip

I.e. that’s a reference only.

After the extra pull, I see:

-rw-r--r-- 1 runner docker 28956993 Jun 2 07:08 largefile.zip

The lfs: ‘true’ is having some effect on the first checkout because I can see it installing LFS and issuing:

/usr/bin/git lfs fetch origin refs/remotes/origin/mybranch

That does not appear to take enough time to be fetching the actual lfs, then it runs

/usr/bin/git checkout --progress --force -B mybranch refs/remotes/origin/mybranch

Which still leaves us with a reference file.

It’s only when I run the second checkout and force a ‘git lfs pull’ do I get the actual file. I don’t see any errors in the first checkout step.

Issue Analytics

  • State:open
  • Created 3 years ago
  • Reactions:24
  • Comments:16 (1 by maintainers)

github_iconTop GitHub Comments

7reactions
itssimoncommented, Aug 11, 2021

Using lfs: true everywhere has the downside of more LFS traffic that you have to pay for though. We only need to download these files for container builds. Other steps, like linting the code base, really don’t need to download big files. I still believe this is best addressed in the action itself, so that it does what it promises consistently.

5reactions
yair-mantiscommented, Mar 22, 2021

mybe this is no longer the case, at least on ubuntu[1]. using ssh key as secret. i use an ‘ls’ on one of the files after the checkout to verify

name: CI 
on:
  workflow_dispatch:
jobs:
  build:
    runs-on: windows-latest
    steps:
      - uses: actions/checkout@v2.3.4
        with:
          lfs: 'true'
          submodules: 'recursive'
          ssh-key: ${{ secrets.git_ssh_key }}

        env:
          GIT_CURL_VERBOSE: '1'
          GIT_TRACE: '1'

[1] #311

Read more comments on GitHub >

github_iconTop Results From Across the Web

git - Github actions actions/checkout@v2 lfs: true flag not ...
The LFS objects seem to be only fetched based on the log. You need to checkout the LFS files inorder for the pointer...
Read more >
Git LFS - large file storage | Atlassian Git Tutorial
Git LFS is a Git extension that improves handling of large files by lazily downloading the needed versions during checkout, rather than during...
Read more >
Git LFS: Why and how to use - mydeveloperplanet.com
Git LFS uses pointers instead of the actual files when the files or file types are marked as LFS files. When a Git...
Read more >
git-lfs-fetch(1) - Arch manual pages
You can configure Git LFS to only fetch objects to satisfy references in certain paths of the repo, and/or to exclude certain paths...
Read more >
Handling Large Files with LFS | Learn Version Control with Git
An LFS-enhanced local Git repository will be significantly smaller in size because it breaks one basic rule of Git in an elegant way:...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found