无法使用git lfs克隆存储库 [英] Fail to clone repository with git lfs

查看:8827
本文介绍了无法使用git lfs克隆存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的回购使用git lfs。对于新鲜的克隆,我运行:

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

克隆到达开始下载lfs文件的位置,到达某个文件,然后失败。每次我尝试克隆时,失败的文件都不相同。

以下是输出:

 克隆进入'回购'... 
远程:计数对象:35699,完成。
remote:压缩对象:100%(17678/17678),完成。
remote:共35699(delta 15603),重用35553(delta 15545)
接收对象:100%(35699/35699),231.45 MiB | 11.12 MiB / s,完成。
解决三角洲问题:完成100%(15603/15603)。
正在下载big_file.big(157.39 KB)
...
正在下载some_other_big_file.big(18.84 KB)
下载对象时出错:some_other_big_file.big

记录到blah.log的错误
使用`git lfs logs last`查看日志。
error:external filter'git-lfs filter-process'failed
fatal:some_other_big_file.big:smudge filter lfs failed
警告:克隆成功,但检出失败。
您可以使用'git status'
检查签出的内容,然后使用'git checkout -f HEAD'

lfs日志说:

 下载对象时出错:some_other_big_file.big 

涂抹错误:缓冲媒体文件错误:无法将数据写入临时文件blah.tmp:LFS:意外的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
gi thub.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

如果我尝试 git lfs pull 在这一点上,一切正常。



任何想法可能会导致此失败下载lfs f我有类似的问题,并有 lfs / git-lfs / issues / 911rel =nofollow noreferrer>已经使用git lfs报告了错误。当错误得到解决的时候,这个解决方法帮助了我,在那里你跳过了它失败的过滤器。

  //跳过涂抹 - 我们稍后会以更快的批次下载二进制文件
git lfs install --skip-smudge

//做git clone here
git clone ...

//获取新克隆中的所有二进制文件
git lfs pull

//恢复污迹
git lfs install --force

现金:@strich


My repo uses 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. The file at which it fails is different each time I attempt to clone. Very occasionally it succeeds.

Here is the 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:

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.

Any idea what could be causing this failure to download the lfs files?

解决方案

I had the similar issue and there was already a bug reported with 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

这篇关于无法使用git lfs克隆存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆