How to merge conflicted file in your branch only in git?
I have two branches branch-A and Integration. When I create pull request for Integration branch I see conflicts in one file. I don’t want to merge whole branch to resolve conflicts, I just want that conflicted file to be merged into branch-A and resolve the conflicts.
Is there any way that I can just merge that conflicted file ONLY to branch-A from Integration branch?
One Solution collect form web for “How to merge conflicted file in your branch only in git?”
I’m not sure if merging only one file is a good idea, but If you really want to do that, just create patch with changes to this file and apply it on branch-A:
$ git checkout branch-A
$ git format-patch branch-A..Integration <file_path> --stdout > changes.patch
$ git am --3way < changes.patch
Applying patch will stop because conflict, resolve it and resume applying:
$ git add <file_path> $ git am --continue