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

Question about about a trivial merge conflict that git should resolve alone

From
FMFrancis Moreau <francis.moro@gmail.com>
Date
Oct 23, 2015, 13:07 UTC
Message-ID
<CAC9WiBj7Vwfjzbik7+d9cxpS=m+_s-CViJ3b4fKAzYQ4ixXfiw@mail.gmail.com>
Hi,
I have a simple merge conflict use case:

$ mkdir foo $ cd foo/ $ git init $ echo line1 > a $ git add . $ git commit -q -m init $ echo line2 >>a $ git commit -a -q -m "add line2" $ git checkout -b foo HEAD~1 $ git cherry-pick -x master $ echo line3 >>a $ git stage a $ git commit -q -m "add line3" $ git checkout master $ git merge foo $ git diff diff --cc a index c0d0fb4,83db48f..0000000

--- a/a
+++ b/a
@@@ -1,2 -1,3 +1,6 @@@
line1
line2
++<<<<<<< HEAD
++=======
+ line3
++>>>>>>> foo

Why does git think there's a conflict here since the "line2" string
was added in both branch by the same commit ?

Thanks.
-- 
Francis
Next: Johannes Schindelin
Message 1 of 2 in “Question about about a trivial merge conflict that git should resolve alone”
  1. Francis MoreauOct 23, 2015
  2. Johannes SchindelinOct 23, 2015

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.