没有完整的索引行,git不能应用二进制补丁*** [英] git cannot apply binary patch *** without full index line
本文介绍了没有完整的索引行,git不能应用二进制补丁***的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
当我尝试从文件中应用补丁时,我看到
When I try to apply a patch from a file, I see
error: cannot apply binary patch to 'my/resource.png' without full index line
error: my/resource.png: patch does not apply
我添加了 my / resource.png
在我做的补丁提交。如何启用全索引支持?
I added my/resource.png
in the commit from which I made the patch. How can I enabled full-index support?
推荐答案
签出您想要创建补丁的分支。运行这个命令:
Checkout the branch from which you want to create the patch. Run this command:
git diff-index 79fd4d7 --binary > ~/Desktop/my-patch
其中 79fd4d7
是在您想要区分的提交范围之前提交的提交的占位符。 (例如,我想要一个包含前面三个提交的补丁:
Where 79fd4d7
is a placeholder for the commit that came right before the range of commits you want to diff. (e.g. I want a patch that contains the first three commits below:
aaa02b0 third commit mine
aabbbcc second commit mine
bb82aed first commit mine
79fd4d7 old commit
然后签出您的新分支并运行 git apply〜/ Desktop / my-patch
Then checkout your new branch and run git apply ~/Desktop/my-patch
这篇关于没有完整的索引行,git不能应用二进制补丁***的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文