How to clone/pull a git repository, ignoring LFS? How to clone/pull a git repository, ignoring LFS? git git

How to clone/pull a git repository, ignoring LFS?


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"


I'm currently struggling myself to find a clean way to download (and remove afterwards) large files with git-lfs.

However, there is a third alternative to the post of @Marcelo Ávila de Oliveira:

git lfs install --skip-smudge

will define globally to skip lfs downloads initially, when cloning repositories.


 

EDIT:I've created a tutorial for basic git-lfs handling. Any feedback and suggestions are very welcome.

You can find it at:

https://sabicalija.github.io/git-lfs-intro/

or pull it via:

git clone https://github.com/sabicalija/git-lfs-intro.git