EGit Auto-Merge and Conflict Resolution
Resolving conflicts in Git with Eclipse is easy in most of the cases. Git has a robust auto-merging implemented. Still, sometimes it will not work automatically. Then you got to resolve these conflicts manually. This topic should provide the necessary steps.
Identify a required merge
The down-arrow signals that there are commits in the remote (origin). These
might cause a conflict.merge
Pull Remote Changes
Right-click / Team / Pull executes a "git pull" in the background. It will try to auto-merge ("git fetch FETCH_HEAD" followed by "git merge").
Conflict Detected
The red symbols signal a conflict that could not be resolved. Right-click on the conflicted source file and select Team / Merge Tool
Accept the default setting.
Resolve Conflicts
The Merge tool is handled similar to SVN conflict resolution. You have to do one at least one edit in the local (left) source file and save. Otherwise the conflicts will not be resolved. To ensure merging worked, open the source file in its default editor.
Stage the merged File
We need to add the merged file to the Index (Staging).
Commit the Merge to your Local Repo
This will create a new "Merge commit" in your local Repo.
Push Everything Back to Origin
If Eclipse refuses to push (authorization issues, etc.), running "git push origin master" (or "git push origin
") in the bash should work.
Checking For Possible Conflicts before Merging/Pulling
You can run a Comparison beforehand to an automatic merge to identify possible issues in auto-merging:
The Synchronize perspective will open and you are able to compare single files (red symbols signal conflicts).