0

We're trying to do a merge between two branches: stable code, and new features.

The merge functionality is not working for us: it sometimes shows conflicts, but often just overwrites files without telling us of any conflict, probably with what it thinks is the right version.

Is it possible to block this overwrite so that it shows us all the conflicting lines? We tried using git diff to get an idea of how extensive it was but there are a couple thousand lines because we had pretty extensive debugging on our stable branch...So we'd really need to get the merge functionality working if at all possible.

So we're in a bit of a messy situation, will greatly appreciate all help.

vishnu
  • 1
  • 1
  • 1
    You would need to give some examples. In my experience, all questions like this ends up being resolved as a misunderstanding about how a git merge actually works. I have never come across git overwriting changes in one branch with changes from another (notice that I mention *changes* in both branches) without being explicitly told to do so. Can you give us a valid example of where git thinks there is no conflict but you think there is? Is there any way you can stage a small example that does the wrong thing, in your opinion? – Lasse V. Karlsen May 07 '19 at 13:21
  • I don't know if there is a way to configure git to always resolve conflicts with a specific strategy but if you suspect such a thing, the .gitconfig file is the place to look. If in doubt, try renaming that file and see if git still misbehaves. – Lasse V. Karlsen May 07 '19 at 13:22
  • I know there are ways to make git do "the wrong thing" by using the merge strategies, but as I mentioned in my other comment, I don't know if there is a way to configure git to use one at all times. I think you need to be pretty explicit about using such a strategy and if you're not doing that, git should stop on conflicts. – Lasse V. Karlsen May 07 '19 at 13:23

1 Answers1

0

In my experience, git merge always worked correctly. It gives conflicts only when there are conflicting changes.

Whenever git doesn't ask you anything during the merge, it's a fast forward merge, and there is no need of an intervention during the merge.

So, ideally there shouldn't be a need to block the default behaviour of git merge.

Krantisinh
  • 1,579
  • 13
  • 16
  • This simply says "you don't have a problem", but I believe the poster does, we just don't know what it is yet, so I feel it is a bit premature to leave an answer. – Lasse V. Karlsen May 07 '19 at 13:23