Skip to content

Instantly share code, notes, and snippets.

@iamalbert
Last active November 30, 2023 22:39
Show Gist options
  • Save iamalbert/ee4b4c89da02e2f9a12b6d700eec7c84 to your computer and use it in GitHub Desktop.
Save iamalbert/ee4b4c89da02e2f9a12b6d700eec7c84 to your computer and use it in GitHub Desktop.
Git skip LFS on local repo

Because GitKraken and SourceTree are FUCKING SLOW for repo with large LFS objects.

Need to completely skip LFS operation when pull/fetch/checkout/...

Skip downloading when clone

GIT_LFS_SKIP_SMUDGE=1 git clone SERVER-REPOSITORY

Skip downloading when fetch/checkout/pull

  1. Edit .git/config
[filter "lfs"]
        clean = git-lfs clean -- %f
        smudge = git-lfs smudge --skip
        process = git-lfs filter-process --skip
        checkout =
        required = false
[lfs]
        fetchexclude = *

such that LFS will not download objects from remote, even if git lfs pull

Remove LFS objects from existing repo

  1. remove all LFS files
  2. rm -f .git/lfs/objects/*, so LFS will not copy from disk.
  3. git reset HEAD --hard

works fine with command line, GitKraken and SourceTree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment