Git clone from local repo with LFS


I have a local git repo, with LFS enabled.

I often need to clone it somewhere else on the same drive. While copy-pasting the repo would do exactly what I want, I face some issue doing this with git itself :

cd C:\wrkfldr\SUBDIR
git clone "C:\wrkfldr\LOCAL_REPO\.git"


Cloning into 'LOCAL_REPO'...
Downloading BIG_LFS_FILE.xlsm (6.4 MB)
Error downloading object: BIG_LFS_FILE.xlsm (01d6d9b): Smudge error: Error downloading BIG_LFS_FILE.xlsm (01d6d9b68a17724fbd7e5aad72b643621edf1ac9ccd34f3ea0874a870af87e4c): batch request: ssh: Could not resolve hostname c: Name or service not known: exit status 255

Errors logged to C:\Users\LOCAL_REPO\.git\lfs\logs\20191203T095345.1265547.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: BIG_LFS_FILE.xlsm: 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 :/'

It looks like LFS wants to download the file, viewing the drive letter C as a protocol, while everything is local.

I’m under Windows 10.

Has anyone ever encountered this ?


For Windows/Linux you have to use file:/// prefix:

git clone file:///C:/wrkfldr/LOCAL_REPO/.git

Check out this interesting answer for details: GIT clone repo across local file system in windows

Answered By – funnydman

This Answer collected from stackoverflow, is licensed under cc by-sa 2.5 , cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply

(*) Required, Your email will not be published