Skip to content

[BUG]: Git LFS checkout does not update large files if repository was previously checked out without Git LFS #5281

@UniQP

Description

@UniQP

What happened?

We have two YAML pipelines that checkout the same Git repository but with different lfs settings:

# Pipeline A
steps:
- checkout: self
  lfs: false

# Pipeline B
steps:
- checkout: self
  lfs: true

On the agent, Pipeline A runs before Pipeline B and they both checkout the same commit into the same directory. However, after the checkout of Pipeline B, the files that are tracked by Git LFS still contain the references to the Git LFS objects rather than the actual file content.

This happens because the checkout task of Pipeline B only runs git lfs fetch origin [ref], which does not update the working copy.

A possible solution would be to run git lfs checkout afterwards or to replace git lfs fetch origin [ref] with git lfs pull origin [ref].

Versions

Agent version 4.258.1 / Windows 10

Environment type (Please select at least one enviroment where you face this issue)

  • Self-Hosted
  • Microsoft Hosted
  • VMSS Pool
  • Container

Azure DevOps Server type

dev.azure.com (formerly visualstudio.com)

Azure DevOps Server Version (if applicable)

No response

Operation system

No response

Version controll system

No response

Relevant log output

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions