【问题标题】:Fail to clone repository with git lfs无法使用 git lfs 克隆存储库
【发布时间】:2017-01-18 10:08:35
【问题描述】:

我的仓库使用 git lfs。对于一个新的克隆,我跑了:

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

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

这是输出:

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'

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

如果我此时尝试git lfs pull,一切正常。

知道是什么原因导致无法下载 lfs 文件吗?

【问题讨论】:

  • 我这里也有同样的问题。您的回购托管在哪里?我的在 VSTS 上。

标签: windows git git-lfs


【解决方案1】:

我有类似的问题,有already a bug reported with git lfs。在解决该错误时,此解决方法对我有所帮助,您可以跳过失败的过滤器。

// 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

致谢:@strich

【讨论】:

  • 这允许我下载 LFS 文件作为链接但没有实际内容。执行“git lfs pull”时出现“smudge filter lfs failed”错误。
  • 这对我有帮助。但是当我有多个分支时。我似乎无法以这种方式结帐到任何其他分支。尽管 git lfs pull 成功了,但检查到其他分支仍然给我涂抹过滤器错误。
  • 什么是 git clone "..." ?
【解决方案2】:

尝试从 GitBash 执行 git lfs pull。

命令提示符似乎没有显示密码弹出窗口,这是git lfs 工作所必需的。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-01
    • 2018-11-23
    • 2017-07-15
    • 2019-10-10
    • 2011-10-24
    相关资源
    最近更新 更多