Git clone from local repo with LFS

元气小坏坏 提交于 2021-01-28 01:48:45

问题


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"

Returns

Cloning into 'LOCAL_REPO'...
done.
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 ?


回答1:


For Windows you need 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



来源:https://stackoverflow.com/questions/59153397/git-clone-from-local-repo-with-lfs

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!