Git Mailing List Archive mirror
 help / color / mirror / Atom feed
From: wuzhouhui14 <wuzhouhui14@foxmail.com>
To: git <git@vger.kernel.org>
Subject: Why conflict when merge a branch that the directory is unmodified
Date: Sat, 20 Apr 2024 11:00:45 +0800	[thread overview]
Message-ID: <tencent_6FF9636AA4D83460C0CE7C9F1EEC3463CF05@qq.com> (raw)

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.

             reply	other threads:[~2024-04-20  3:09 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-04-20  3:00 wuzhouhui14 [this message]
2024-04-23  7:26 ` Why conflict when merge a branch that the directory is unmodified Konstantin Khomoutov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=tencent_6FF9636AA4D83460C0CE7C9F1EEC3463CF05@qq.com \
    --to=wuzhouhui14@foxmail.com \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).