eclipsegitmergeegiteclipse-mars

How can I get rid of Eclipse Git "conflict" icons after all merges are resolved?


I get the Git conflict icon in Eclipse on lots of files, even though it seems that I resolved any possible conflicts.

In Eclipse 4.5.2, in the Project view, I select a project root and do right-click -> Compare to branch origin/master. Next, we see the Team Synchronization view. Many files show a red conflict icon.conflict icon, but they should not.

The Git staging view, which is supposed to show conflicts, is empty. I already tried Merge; Committing the merge (nothing remains to be committed). I tried Add to Index from the Git Staging view; and even Overwrite from the Team Synchronization view. Comparing the local and origin files shows that they are identical.

Git setting autocrlf is true, so that is not the issue.

This occurs repeatedly.

Why do I see this conflict icon? How can I get rid of it?

Staging


Solution

  • Did you do a pull? Or where you just comparing in Team Synchronization? In my experience the Team Synchronization perspective confuses the most people.

    In general it should be used "read-only". Don't try to resolve any conflicts here. Per default you are comparing your working copy against the remote repository. Which means you actually have no conflict in your working copy. When you "fix" them here you are just making a local modification. You can commit that but it doesn't resolve any conflict. It makes the actual conflict even harder to resolve.

    So don't do anything in the Team Synchronization perspective. Just do a pull to have those conflicts in your working copy and then resolve them. A merge conflict is marked as merged by moving them to the Staged Changes.

    If something breaks and you want a new try do a reset --hard on the last commit in your local repository.