When applying a patch is there any way to resolve conflicts?

前端 未结 4 1673
遇见更好的自我
遇见更好的自我 2020-12-22 15:34

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

4条回答
  •  南笙
    南笙 (楼主)
    2020-12-22 16:19

    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).

提交回复
热议问题