Thursday, December 20, 2012

EGit: How to resolve a merge conflict


To resolve a merge conflict, two ways.


Using Merge Tool

  • select the top level resource showing the red conflict label decorator
  • click Team > Merge Tool
  • select the merge mode Use HEAD (the last local version) of conflicting files and click OK
Image:Egit-0.10-select-merge-mode.png
  • the merge editor opens showing the working tree version in the left pane and the version to be merged in the right pane
Image:Egit-0.10-merge-tool.png
  • edit the working tree version until you are happy with it
  • Team > Add the merged resource to mark the conflict as resolved
  • commit the merge commit via Team > Commit



Manual conflict resolution
To resolve a conflict you have to do the following steps:
§  Navigate to the conflicting resource
§  Edit the content of the conflicting resource
§  Tell EGit that the conflict is resolved with Team > Add
§  Commit the conflict resolution with Team > Commit

1 comment:

  1. "edit the working tree version until you are happy with it"
    How do you use the "copy current change from right to left" button.
    It seams finicky at best.

    ReplyDelete