简体   繁体   English

无法使用 git lfs 克隆存储库

[英]Fail to clone repository with git lfs

My repo uses git lfs.我的仓库使用 git lfs。 For a fresh clone, I ran:对于一个新的克隆,我跑了:

git lfs install
git clone https://example.com/repo.git

The clone gets to the point where it starts downloading lfs files, gets to some file and then fails.克隆到达开始下载 lfs 文件的地步,到达某个文件然后失败。 The file at which it fails is different each time I attempt to clone.每次我尝试克隆时失败的文件都是不同的。 Very occasionally it succeeds.偶尔它会成功。

Here is the output:这是 output:

Cloning into 'repo'...
remote: Counting objects: 35699, done.
remote: Compressing objects: 100% (17678/17678), done.
remote: Total 35699 (delta 15603), reused 35553 (delta 15545)
Receiving objects: 100% (35699/35699), 231.45 MiB | 11.12 MiB/s, done.
Resolving deltas: 100% (15603/15603), done.
Downloading big_file.big (157.39 KB)
...
Downloading some_other_big_file.big (18.84 KB)
Error downloading object: some_other_big_file.big

Errors logged to blah.log
Use `git lfs logs last` to view the log.
error: external filter 'git-lfs filter-process' failed
fatal: some_other_big_file.big: smudge filter lfs failed
warning: Clone succeeded, but checkout failed.
You can inspect what was checked out with 'git status'
and retry the checkout with 'git checkout -f HEAD'

The lfs logs say: lfs 日志说:

Error downloading object: some_other_big_file.big

Smudge error: Error buffering media file: cannot write data to tempfile "blah.tmp": LFS: unexpected EOF:
github.com/git-lfs/git-lfs/errors.newWrappedError
        C:/Go/src/github.com/git-lfs/git-lfs/errors/types.go:166
github.com/git-lfs/git-lfs/errors.NewSmudgeError
        C:/Go/src/github.com/git-lfs/git-lfs/errors/types.go:252
github.com/git-lfs/git-lfs/lfs.PointerSmudge
        C:/Go/src/github.com/git-lfs/git-lfs/lfs/pointer_smudge.go:70
github.com/git-lfs/git-lfs/lfs.(*Pointer).Smudge
        C:/Go/src/github.com/git-lfs/git-lfs/lfs/pointer.go:65
github.com/git-lfs/git-lfs/commands.smudge
        C:/Go/src/github.com/git-lfs/git-lfs/commands/command_smudge.go:84
github.com/git-lfs/git-lfs/commands.filterCommand
        C:/Go/src/github.com/git-lfs/git-lfs/commands/command_filter_process.go:65
github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra.(*Command).execute
        C:/Go/src/github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra/command.go:477
github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra.(*Command).Execute
        C:/Go/src/github.com/git-lfs/git-lfs/vendor/github.com/spf13/cobra/command.go:551
github.com/git-lfs/git-lfs/commands.Run
        C:/Go/src/github.com/git-lfs/git-lfs/commands/run.go:66
main.main
        C:/Go/src/github.com/git-lfs/git-lfs/git-lfs.go:33
runtime.main
        C:/Go/src/runtime/proc.go:183
runtime.goexit
        C:/Go/src/runtime/asm_amd64.s:2086

If I try git lfs pull at this point, everything works fine.如果此时我尝试git lfs pull ,一切正常。

Any idea what could be causing this failure to download the lfs files?知道是什么导致无法下载 lfs 文件吗?

I had the similar issue and there was already a bug reported with git lfs .我遇到了类似的问题,并且git lfs 已经报告了一个错误 While the bug was being resolved, this workaround helped me, where you skip the filter where it was failing.在解决该错误的同时,此解决方法对我有所帮助,您可以跳过失败的过滤器。

// Skip smudge - We'll download binary files later in a faster batch
git lfs install --skip-smudge

// Do git clone here
git clone ...

// Fetch all the binary files in the new clone
git lfs pull

// Reinstate smudge
git lfs install --force

Credits: @strich学分:@strich

Try to do git lfs pull from GitBash.尝试从 GitBash 执行git lfs pull

It looks like the commandprompt isn't showing pass key popup, which is necessary for git lfs to work.看起来命令提示符没有显示密码弹出窗口,这是git lfs工作所必需的。

Git config settings Git 配置设置

git config --global http.sslVerify true

git config --global http.sslBackend schannel

This worked for me这对我有用

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM