当我尝试时,您能否告诉我如何解决“补丁不适用”错误
“git 应用补丁”?
$ git apply 0001-my.patch
error: patch failed:test.xml:114
error: text.xml: patch does not apply
我的本地目录中有“test.xml”。当我执行“git status”时,它显示我没有本地更改。
感谢您的任何帮助。
您可以尝试:
git am -3
当补丁不能完全应用时,请使用 3 路合并(git am doc http://www.kernel.org/pub/software/scm/git/docs/git-am.html)
qneill https://stackoverflow.com/users/468252/qneill中提到评论 https://stackoverflow.com/questions/1842926/error-in-running-git-apply/1842964#comment22200507_1842964 that git apply现在有一个--3way option http://git.661346.n2.nabble.com/PATCH-v4-00-19-quot-git-apply-3way-quot-td7562763.html:
您现在可以应用补丁而无需减少上下文。
因为它将在索引中留下冲突的一半,并让您手动解决工作树中的冲突,”--3way
“ 暗示 ”--index
”,并且不能与“一起使用--cached
" or "--reject
".
您可以在git1.7.12 发行说明 https://github.com/git/git/blob/master/Documentation/RelNotes/1.7.12.txt(2012 年 8 月,距离最初的问题提出还不到 3 年)
"git apply
“学会了在补丁不完全适用于您拥有的版本时调整基本版本并执行三向合并。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)