Skip to content

import: from external git does not import lfs-tracked file content #9175

@morteza

Description

@morteza

Bug Report

Description

I encountered an issue when trying to import an external git repository that contains files tracked by git-lfs (using either import or get). Files not tracked by git-lfs are imported correctly, however the lfs-tracked files only contain pointers to the lfs instead of the actual content.

Reproduce

  1. Run dvc import https://huggingface.co/datasets/morteza/cogtext.git gpt3/abstracts_gpt3ada.nc
  2. Run dvc pull
  3. Open the abstracts_gpt3ada.nc file, which should contain the actual binary content but instead contains text pointers to the lfs object.

Expected

When importing LFS-tracked files from an external git repository, the files should contain the actual content and not text pointers.

Environment information

DVC version: 2.47.2 (pip)
-------------------------
Platform: Python 3.11.0 on Linux-5.15.0-67-generic-x86_64-with-glibc2.35
Subprojects:
        dvc_data = 0.42.3
        dvc_objects = 0.21.1
        dvc_render = 0.2.0
        dvc_task = 0.2.0
        scmrepo = 0.1.15
Supports:
        http (aiohttp = 3.8.4, aiohttp-retry = 2.8.3),
        https (aiohttp = 3.8.4, aiohttp-retry = 2.8.3),
        ssh (sshfs = 2023.1.0)
Cache types: hardlink, symlink
Cache directory: ext4 on /dev/sdb5
Caches: local
Remotes: None
Workspace directory: ext4 on /dev/sdb5
Repo: dvc, git

Metadata

Metadata

Assignees

Labels

feature requestRequesting a new featuregitRelated to git and git backends

Type

No type

Projects

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions