问题描述
我有一个本地git repo,并启用了LFS.
I have a local git repo, with LFS enabled.
我经常需要将其克隆到同一驱动器上的其他位置.虽然复制粘贴存储库完全可以实现我想要的功能,但在使用 git
本身执行此操作时,我会遇到一些问题:
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'...
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 :/'
LFS似乎要下载文件,并以协议形式查看驱动器号 C
,而所有内容都是本地的.
It looks like LFS wants to download the file, viewing the drive letter C
as a protocol, while everything is local.
我在Windows 10下.
I'm under Windows 10.
有人遇到过这个吗?
推荐答案
对于Windows,您需要使用 file:///
前缀:
For Windows you need to use file:///
prefix:
git clone file:///C:/wrkfldr/LOCAL_REPO/.git
查看此有趣的答案以获取详细信息: GIT克隆存储库Windows中的本地文件系统中
Check out this interesting answer for details: GIT clone repo across local file system in windows
这篇关于使用LFS从本地存储库克隆Git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!