Why conflict when merge a branch that the directory is unmodified
- From
- wuzhouhui14 <wuzhouhui14@foxmail.com>
- Date
- Apr 20, 2024, 03:00 UTC
- Message-ID
- <tencent_6FF9636AA4D83460C0CE7C9F1EEC3463CF05@qq.com>
Hi,
Suppose I have two branches with following commit histories:
B----C---D(directory abc/ modified) Branch1
/
L--M---O(directory abc/ not modified) Branch2In previous graph, the Branch1 merge Branch2 in commit C. After commit C, the Branch1 modified some contents in director abc/. Branch2 doesn't modify directory abc/ since commit M, which has been merged into Branch1.
Then, when I do:
git checkout Branch1 git merge Branch2
the director abc/ contains conflicts, why? Because the director abc/ doesn't changed since commit M in Branch2, so directory abc/ should not have conflicts.
Thanks.