An earlier process of resolving conflicts (through the staging view) in Eclipse seemed much more intuitive several years ago, so either the tooling no longer functions in the way that I was used to, or I am remembering the process of resolving merge conflicts within SVN repositories. Regardless, there was this nifty "Mark as Merged" menu option when right-clicking on a conflicting file.
Fast forward to 2019, I am using the "Git Staging" view in Eclipse (v4.11). Actually, I am using STS (Spring Tool Suite 3.9.8), but I think the Git Staging view is a standard Eclipse plugin for working with Java/Spring-based projects. I share the following approach in case it helps anyone else, and because I grow weary or resolving merge conflicts from the GIT command line. ;-)
Because the feature I recall is now gone (or perhaps done differently with the current version of GIT and Eclipse), here are the current steps that I now follow to resolve merge conflicts through Eclipse using a GIT repository. It seems the most intuitive to me. Obviously, it is clear from the number of responses here that there are many ways to resolve merge conflicts. Perhaps I just need to switch to JetBrains IntelliJ, with their three-way merge tool.
- Double-click on the offending file
- A "Text Compare" interface appears, with side-by-side views of the conflicting commits.
- Identify which view is the local state of the file, or the most recent commit.
- Make changes to the local window, either adding or redacting the changes from the offending commit.
- When the desired set of changes has been reviewed and updated, right-click on the unstaged file.
- Click the "Add to Index" option, and your file will be added to the staged changes.
- This also removes the conflicting file from the unstaged list, thus indicating that it has been "marked as merged"
- Continue this process with each additional file in conflict.
- When you have reivewed all conflicting files, confirm that all desired files (including additional changes) are staged.
- Add an appropriate commit message.
- Commit and push the "merged" files to the origin repository, and this officially marks your files as merged.
NOTE: Because the menu options are not intuitive, a number of things can be misleading. For example, if you have saved any updates locally, and try to reopen the conflicting file to confirmand that the changes you made have persisted, confusion may result since the original conflict state is opened... not your changes.
But once you add the file(s) to the index, you will see your changes there.
I also recommend that when you pull in changes that result in a merge conflict, that you "stash" your local changes first, and then pull the changes in again. At least with GIT, as a protection, you will not be allowed to pull in external changes until you either revert your changes or stash them. Discard and revert to the HEAD state if the changes are not important, but stash them otherwise.
Finally, if you have just one or two files changing, then consider pulling them into separate text files as a reference, then revert to the HEAD and then manually update the file(s) when you pull changes across.