我正在尝试使用 git am -3 “补丁路径”将一系列补丁从一个 git 存储库应用到另一个 git 存储库。我按顺序应用它们,从补丁 1-4 开始,效果很好。
但是当我来到第 5 个补丁时,我收到错误提示“fatal: sha1 information is lacked or useless”。我转到应用补丁的 git 存储库,我确实看到了文件“dev/afile”。 所以我想知道为什么 git 会提示“缺少或无用的 sha1 信息 (dev/afile.c)”,我该如何解决我的问题?
$ 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".
为什么它说“补丁在 0001 第一个补丁失败”,当我执行“git am -3 ~/Tmp/mypatches/0005-fifth.patch”时,它完成且没有错误。
谢谢。
最佳答案
只需执行以下操作即可解决此问题:
patch -p1 < example.patch
关于git - 获取错误消息 '' 致命 : sha1 information is lacking or useless"when apply a patch using "git am -3",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/32557855/