Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

EGit "synchronize workspace" won't mark merge conflict as resolved

Until now I merge simply with the fetch+merge approach and if there was a merge conflict I fixed it manually, staged it and commited. It resolved just fine.

Now I decided to try out the "synchronize workspace" thingie. I checkout my local branch and run that command on the remote branch of origin. How do I pull single files into my repository?

I tried using merge or pull, but instead of integrating the change, it suddenly tells me that there is a merge conflict. This conflict should not occur in the first place, but indexing and committing again does not fix the error. I synchronize with workspace and it keeps showing the two sided red error on two identical files...

like image 625
Jan Avatar asked Oct 19 '22 03:10

Jan


2 Answers

In my experience Synchronize Workspace 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.

I recommend not doing anything in the Team Synchronization perspective. Just do a pull (or fetch/merge) to have those conflicts in your working copy and then resolve them. You know how to do that. If something breaks and you want a new try do a reset --hard on the last commit in your local repository and start over.

like image 79
Kai Avatar answered Oct 27 '22 10:10

Kai


Try instead a fetch + rebase: you will have to resolve the conflict again, but once that is done, your amended commit should be on top of origin/master: the next fetch should do nothing, since everything was fetched.

See this tutorial:

http://eclipsesource.com/blogs/wp-content/uploads/2012/09/Screen-Shot-2012-09-25-at-3.34.08-PM.png

like image 45
VonC Avatar answered Oct 27 '22 09:10

VonC