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

前端 未结 2 1292
南笙
南笙 2020-12-14 00:46

Is there a way to explicitly ignore all git-lfs files on clone and pull?
(besides uninstalling git-lfs which I ended up doing).

2条回答
  •  清歌不尽
    2020-12-14 01:12

    Two alternatives:

    1) Using the GIT_LFS_SKIP_SMUDGE variable:

    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"
    git clone SERVER-REPOSITORY
    

    To undo this configuration, execute:

    git config --global filter.lfs.smudge "git-lfs smudge -- %f"
    

提交回复
热议问题