在应用补丁时有什么办法来解决冲突? [英] When applying a patch is there any way to resolve conflicts?
问题描述
由于各种原因,我们有不同的svn分支的多个git实例。
很多时候我想修复存储库A中的问题,生成一个补丁,并将其应用于存储库B.这可以正常工作,除非有冲突。
重新绑定时,我只需右键单击该文件夹并使用tortioseGit并选择解析选项。这带来了一个很好的gui让我通过我的冲突工作。
有没有办法通过拒绝的补丁块来完成这项工作?
这是我目前创建/应用补丁
git format-patch master --stdout> c:\\\patch\\file.patch
git apply --reject --ignore-space-change --ignore-whitespace c:\\patch\\file.patch
要生成您的修补程序,请执行以下操作:
git format-patch --stdout first_commit ^ .. last_commit> changes.patch
现在,当您准备好应用补丁时:
git am -3< changes.patch
<<<<<>,则可以执行
, git mergetool
;<<<<< code>< code> |||||| >>>> ;>>
解决冲突)。
I am on windows.
For various reasons we have multiple git instances of different svn branches.
Many times I want to fix an issue in repository A, generate a patch, and apply it to repository B. This works fine except if there are conflicts.
When rebasing I just right click the folder and use tortioseGit and select the resolve option. This brings up a nice gui to let me work through my conflicts.
Is there any way to accomplish this with rejected patch chunks?
Here is my current approach to creating/applying the patches
git format-patch master --stdout > c:\\patch\\file.patch
git apply --reject --ignore-space-change --ignore-whitespace c:\\patch\\file.patch
To generate your patch do the following:
git format-patch --stdout first_commit^..last_commit > changes.patch
Now when you are ready to apply the patches:
git am -3 < changes.patch
the -3
will do a three-way merge if there are conflicts. At this point you can do a git mergetool
if you want to go to a gui or just manually merge the files using vim (the standard <<<<<<
, ||||||
, >>>>>>
conflict resolution).
这篇关于在应用补丁时有什么办法来解决冲突?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!