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

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

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

ベストアンサー1

パッチを生成するには、次の手順を実行します。

git format-patch --stdout first_commit^..last_commit > changes.patch

パッチを適用する準備ができたら、次の手順を実行します。

git am -3 < changes.patch

競合がある場合、は-33 者間マージを実行します。この時点で、git mergetoolGUI に移動する場合は を実行するか、 vim (標準の<<<<<<||||||>>>>>>競合解決) を使用してファイルを手動でマージすることができます。

おすすめ記事