git 涂抹错误:下载错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/46521122/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Smudge error: Error downloading
提问by Dan-Dev
I'm not sure if this is the right forum to discuss git-lfs but as we have a tag for it I'll post my question. I have read the "Troubleshoot Git LFS in Bitbucket" page.
我不确定这是否是讨论 git-lfs 的合适论坛,但由于我们有一个标签,我会发布我的问题。我已阅读“Bitbucket 中的 Git LFS 疑难解答”页面。
I'm getting the following error when runing:
运行时出现以下错误:
ssh-agent bash -c 'ssh-add /home/dan/.ssh/keyname; git clone [email protected]:[repo name removed].git'
$ git-lfs smudge -- [Filename removed].zip Error downloading object: [Filename removed].zip ([code removed]): Smudge error: Error downloading [Filename removed].zip ([code removed]): [[code removed] Object does not exist on the server: [404] Object does not exist on the server
[404] Object does not exist on the server github.com/git-lfs/git-lfs/errors.newWrappedError /tmp/docker_run/src/github.com/git-lfs/git-lfs/errors/types.go:170: [[code removed]] Object does not exist on the server github.com/git-lfs/git-lfs/errors.newWrappedError /tmp/docker_run/src/github.com/git-lfs/git-lfs/errors/types.go:170: Error downloading [Filename removed].zip ([code removed]) github.com/git-lfs/git-lfs/errors.newWrappedError /tmp/docker_run/src/github.com/git-lfs/git-lfs/errors/types.go:170: Smudge error
$ git-lfs smudge -- [文件名已删除].zip 下载对象时出错:[文件名已删除].zip ([代码已删除]):涂抹错误:下载[文件名已删除].zip 时出错([代码已删除]):[[代码已删除]服务器上不存在对象:[404]服务器上不存在对象
[404] 服务器上不存在对象 github.com/git-lfs/git-lfs/errors.newWrappedError /tmp/docker_run/src/github.com/git-lfs/git-lfs/errors/types.go: 170: [[代码删除]] 服务器上不存在对象 github.com/git-lfs/git-lfs/errors.newWrappedError /tmp/docker_run/src/github.com/git-lfs/git-lfs/errors /types.go:170: 下载 [文件名已删除].zip ([代码已删除]) 时出错 github.com/git-lfs/git-lfs/errors.newWrappedError /tmp/docker_run/src/github.com/git-lfs /git-lfs/errors/types.go:170: 涂抹错误
Has anyone got any advice?
有没有人有任何建议?
回答by Dan-Dev
I eventually found an answer by strich: on https://github.com/git-lfs/git-lfs/issues/911
我最终通过 strich 找到了答案:在https://github.com/git-lfs/git-lfs/issues/911
I've had similar issues in the past and I think there may be a potential bug in cloning with git lfs (Still to be determined). You can try this method of fetching the repo, which is in fact faster too:
// 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
This only needs to be done once to initialize the clone for the first time.
Please do test it and let me know if it fixes it.
我过去也遇到过类似的问题,我认为在使用 git lfs 进行克隆时可能存在潜在的错误(仍有待确定)。您可以尝试这种获取 repo 的方法,它实际上也更快:
// 跳过污迹 - 我们稍后会以更快的速度批量下载二进制文件 git lfs install --skip-smudge
// 在这里执行 git clone git clone ...
// 获取新克隆中的所有二进制文件 git lfs pull
// 恢复涂抹 git lfs install --force
只需执行一次即可首次初始化克隆。
请进行测试,如果它修复它,请告诉我。
回答by Danger
This corruption can happen due to another developer's misconfigured git-lfs that pushed to the repository, or sometimes due to some unusual failure during a push. Try re-sending the missing object (using its object ID) from a working tree:
这种损坏可能是由于另一个开发人员错误配置了推送到存储库的 git-lfs,或者有时是由于推送期间的一些异常失败。尝试从工作树重新发送丢失的对象(使用其对象 ID):
git lfs push --object-id <remote> <oid>
The OID should be in the Smudge error message.
OID 应该在 Smudge 错误消息中。