3

When I merge master down into my dev branch, EGit shows files in conflict. So I go to the Git Staging view, where the conflicting files are shown under "Unstaged Changes" with a red conflict marker on their name. For each file, I right-click it, choose "Merge Tools", the conflict editor shows up with my code on the left and the master code on the right, I manually solve the conflicts and add the file to the index, so it moves from "Unstaged Changes" area to "Staged Changes". This is all good.

However, when I open the Merge Tool, while the editor actually displays the non-conflicting changes in blue and the conflicting changes in red, in many occasions there are no red changes at all, only blue changes, as though there were no conflicting changes whatsoever, and all I do to solve the conflicts (?) is to click "Copy all non-conflicting changes from right to left".

So why was the file shown as conflicting in the first place ? There must be something going on that I am missing big time. This is what I'm trying to understand.

ADDED: While my main reason for concern is simply that I don't understand why there are no changes marked in red in a conflicted file, so I'm not sure what's going on, so I might be screwing up when committing back to master, another big point of this issue for me is that all those files marked as conflicting but showing no conflicting changes are dealt with by simply copying the non-conflicting changes (that is all the changes) from right to left, which to me amounts to making my file identical to the one being merged into mine, which in turn would amount to simply overwriting my file with the other one, which is something that I think I shouldn't be doing manually file by file. So I'm also trying to understand if there is a way to make the EGit merge automatically replace my files when they are in that state (that is in conflict but with no conflicting changes marked).

SantiBailors
  • 1,596
  • 3
  • 21
  • 44
  • Simply because you didn't visually see any differences in the two versions of the file does not mean that they weren't any changes. There could be differences in whitespace/line endings, for example. – Tim Biegeleisen Dec 06 '16 at 08:32
  • @TimBiegeleisen I do see differences. The editor actually displays the non-conflicting changes in blue and the conflicting changes in red, but in many occasions there are no red changes at all, only blue changes. No matter how the changes originated, if the file is shown as conflicting I expect to be able to manually solve the conflicts, but I cannot if the merge tool does not show me where they are. Differences in whitespace do get shown when they actually exist (I can hide them if I select "Ignore white space"). – SantiBailors Dec 06 '16 at 08:36
  • Are you asking _why_ this is happening or how to _deal_ with this? – Tim Biegeleisen Dec 06 '16 at 08:38
  • @TimBiegeleisen I'm asking why. Once I understand what's going on I expect to be able to decide how to deal with it. – SantiBailors Dec 06 '16 at 08:40
  • I suggested whitespace and line endings as a possible explanation. – Tim Biegeleisen Dec 06 '16 at 08:41
  • @TimBiegeleisen I don't think you explained why no red markers are shown. That's what I am asking. BTW when there is a conflict on whitespaces, that is definitely shown in red, I see that often. – SantiBailors Dec 06 '16 at 08:44
  • Hmmm...a difference in line endings might not be visible though. Here is why: On Windows the line endings is `\r\n` while on Unix it is `\n`, but the visual tool you are using might not be flagging this. – Tim Biegeleisen Dec 06 '16 at 08:46
  • @TimBiegeleisen It's very possible that the merge editor is not displaying differences in line-ending, but it is not even placing a red marker at that line, while the file is being flagged as in conflict (red marker on the file name). In my case it does not sound likely that the conflicts are on line endings - in our team we all use Eclipse on Windows and I can't see why so many line-ending differences might arise, and only on some files. I have the feeling there is something more going on. But I appreciate your hypothesis and I am considering it. – SantiBailors Dec 06 '16 at 08:59
  • Facing same problem. Is there any way to merge(copy non-conflicting changes) files in bulk? – Deckard Apr 29 '19 at 09:28
  • @Deckard Not that I am aware of. Besides here, I have tried to ask around, but all I get, provided they accept that the files are equal, is that I don't understand what conflicts are. In the meantime I switched to IntelliJ in the context where I was having that problem. I can only suggest to make sure you are on the latest Eclipse and EGit versions, or try those merges with an external Git client like TortoiseGit (but I don't know if this is only an EGit issue or a general Git issue). – SantiBailors Apr 29 '19 at 09:55

0 Answers0