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?
- What are the use-cases for local branches tracking other local branches?
- Consistent tagging across multiple projects in separate Git repositories
- Git for Web Development (procedure method)
- Why git merge generate two same change history after push the merged commit?
- git-svn: how do I create a new svn branch via git?
- Git FileRevision get comment with multiple lines - gets only first line
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