For example:
- I have a master branch.
- I create a file
file.txt
and I writeMaster branch
in it, and then I commit it. - I create another branch called
fix20
, and modify the text offile.txt
toThis is fix20 branch
. Then I commit it. - I switch to the master branch and then I create a branch
hotfix
and switch to it. - I modify
file.txt
to have the textThis is the HotFix
. After that I commit the changes. - Now I switch back to the master branch and merge it with the hotfix. The file (with no problems) changes it text to
This is the HotFix
(They are basically merged)).
Now I merge with the fix20 branch and I get a merging conflict. The file.txt
has both the text from fix20 branch and the text, that I had after merging with HotFix. At this point, I should open an editor and decide, what should be left, and what should be removed.
The question is: Why does the merging conflict happen the second time? Why didnt I decide which text to leave, when I merged the master with the hotfix? Why havent the files been merged, when I merged with fix20 branch (why the text was not just replaced as with the hotfix)? Why basically this conflict happens the second time and not the first one???