有几个类似的问题,但没有一个具体解决这个问题:
我有一个git存储库,它的初始提交添加了项目版本1.0中包含的所有文件,我们称之为
foo
.以下所有提交都添加了特定的修改
foo 1.0
。我现在想将对特定子目录所做的更改移植到的另一个版本,
foo 2.0
.为此,我首先创建了一个修补程序:
git format-patch --stdout SOME_COMMIT_ID..HEAD -- subdir > subdir.patch
因为
foo公司
版本之间
1.0
和
2.0
此修补程序无法干净地应用于
foo 2.0
.没关系,我想手工解决任何冲突。但我怎么能让我这么做呢?常用建议如下:
git am -3 < subdir.patch
应该执行三方合并。但所有这些都会输出一系列错误:
error: patch failed: ...
最终:
It does not apply to blobs recorded in its index.
Patch failed at 0001 commit SOME_COMMIT_ID
hint: Use 'git am --show-current-patch=diff' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".
这对我没有帮助,为什么git不让我手动修复冲突?