Table of contents

Clone without Downloading LFS Files on a System with Git LFS Installed

Git Jan 24, 2024 Viewed 64 Comments 0

Issue

My computer install git lfs, and I want to clone https://huggingface.co/datasets/allenai/objaverse. I run git clone https://huggingface.co/datasets/allenai/objaverse

$ git clone https://huggingface.co/datasets/allenai/objaverse
Cloning into 'objaverse'...
remote: Enumerating objects: 801333, done.
remote: Total 801333 (delta 0), reused 0 (delta 0), pack-reused 801333
Receiving objects: 100% (801333/801333), 126.71 MiB | 15.39 MiB/s, done.
Resolving deltas: 100% (1637/1637), done.
error: external filter 'git-lfs filter-process' failed
error: git-lfs filter-process died of signal 15
fatal: glbs/000-088/b6ae866b52d24da1bea14aaa27bf808c.glb: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry with 'git restore --source=HEAD :/'

This project with lfs taking up a lot of space. I want to clone without downloading LFS files first.

Solution

There are two alternatives:

1. Using the GIT_LFS_SKIP_SMUDGE variable

GIT_LFS_SKIP_SMUDGE=1 git clone SERVER-REPOSITORY

Obs: for "Windows", use the following two commands:

set GIT_LFS_SKIP_SMUDGE=1  
git clone SERVER-REPOSITORY

2. Configuring the git-lfs smudge

git config --global filter.lfs.smudge "git-lfs smudge --skip -- %f"
git config --global filter.lfs.process "git-lfs filter-process --skip"
    
git clone SERVER-REPOSITORY

To undo this configuration, execute:

git config --global filter.lfs.smudge "git-lfs smudge -- %f"
git config --global filter.lfs.process "git-lfs filter-process"
Updated Jan 24, 2024