获取错误消息“致命的:sha1信息缺乏或无用”当使用“git am -3”应用补丁时, [英] Get error message ''fatal: sha1 information is lacking or useless" when apply a patch using "git am -3"

查看:970
本文介绍了获取错误消息“致命的:sha1信息缺乏或无用”当使用“git am -3”应用补丁时,的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用git am -3修补程序路径将一系列修补程序从1个git存储库应用到另一个git存储库。我应用它们的顺序是从1-4开始的,它工作的很好。



但是当我来到第5个补丁时,我得到一个错误:致命的:sha1信息是缺乏或无用。我去应用补丁的git仓库,我看到文件'dev / afile'。
所以我想知道为什么git抱怨sha1信息缺乏或无用(dev / afile.c),我该如何解决我的问题?

应用:rpmsg:允许设备使用自定义缓冲区分配器
fatal:sha1信息缺失或无用(dev / afile.c)。
版本库缺少必要的Blob以支持3路合并。
不能回退到三路合并。
补丁失败,第一次补丁
当你解决这个问题时,运行git am --resolved。
如果您希望跳过此修补程序,请运行git am --skip。
要恢复原始分支并停止修补运行git am --abort。

为什么它说修补程序在0001第一个补丁失败,当我做git am -3 〜/ Tmp / mypatches / 0005-fifth.patch,完成后没有错误。

谢谢。

解决方案

0001 - 开头的补丁文件无法清晰地应用 - 存在一些冲突。



Git希望通过查看此修补程序基于的提交来解决该冲突,但是您的存储库中没有提交这些提交。



可能该修补程序是由一个分支创建的,该分支提交了永不共享的分支,或者您的分发者或提交者分支已重新分配。



无需担心修补程序 0005 - 无错误。错误大概是 0001 -


I am trying to apply a series of patches from 1 git repository to another git repository using git am -3 "path to a patch". I apply them in order, from patch 1-4, it works fine.

But when I come to 5th patch,I get the error saying "fatal: sha1 information is lacking or useless". I go the to git repository where I apply the patch, I do see the file 'dev/afile'. So I wonder why git is complaining about "sha1 information is lacking or useless (dev/afile.c)" and how can I fix my problem?

 $ git am -3 ~/Tmp/mypatches/0005-fifth.patch
Applying: rpmsg: Allow devices to use custom buffer allocator
fatal: sha1 information is lacking or useless (dev/afile.c).
Repository lacks necessary blobs to fall back on 3-way merge.
Cannot fall back to three-way merge.
Patch failed at 0001 first patch
When you have resolved this problem run "git am --resolved".
If you would prefer to skip this patch, instead run "git am --skip".
To restore the original branch and stop patching run "git am --abort".

And why it said "Patch failed at 0001 first patch", when I do "git am -3 ~/Tmp/mypatches/0005-fifth.patch", it completes with no error.

Thank you.

解决方案

The patch file starting with 0001- cannot be applied cleanly - there is some conflict.

Git wanted to resolve that conflict by looking at commits this patch has been based on, but you don't have those commits in your repository.

Probably the patch has been created from a branch that had commits that were never shared, or either your or submitter's branch has been rebased.

It doesn't matter that patch 0005- can be applied with no error. The error is about 0001- specifically.

这篇关于获取错误消息“致命的:sha1信息缺乏或无用”当使用“git am -3”应用补丁时,的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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