git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Why conflict when merge a branch that the directory is unmodified

From
Wwuzhouhui14 <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)            Branch2

In 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.
Next: Konstantin Khomoutov
Message 1 of 2 in “Why conflict when merge a branch that the directory is unmodified”
  1. wuzhouhui14Apr 20, 2024
  2. Konstantin KhomoutovApr 23, 2024

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.