0

I'm trying to merge two repositories. But whenever I merge, it should give conflict in sample.txt file rather that overwriting the same. Steps followed are in attached image.Git version is : 2.7.4 Is the process right? if yes, the why don't I get conflicts?

repro

Full-size image here.

1 Answer 1

2

This is the expected behaviour, this use case should not lead to a conflict. There is no “real” merging done, since the changes from the branch can be simply applied to master as if the other branch never existed (this is called a “fast-forward merge”). Before merge:

--A--B <-- master \ C--D <-- branch 

After merge:

--A--B--C--D <-- master 

If you wanted to see a conflict, you would have to create a history like this:

--A--B--D <-- master \ C--E <-- branch 

Now if the commit D “touches the same lines” as C and E, there could be a conflict when you try to merge back to master.

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.