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

Re: merge conflict diff

From
Matthieu Moy <matthieu.moy@imag.fr>
Date
Apr 3, 2008, 16:48 UTC
Message-ID
<vpqk5jeubop.fsf@bauges.imag.fr>
In-Reply-To
<20080403142649.GA16699@coredump.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 19 quoted lines
> On Thu, Apr 03, 2008 at 08:13:04AM -0600, Jeremy Ramer wrote:
>
>> I am trying to figure out how to quickly diff two source files that
>> led to a merge conflict.  When a conflict occurs the command
>> [...]
>> So far I am thinking of
>> # git checkout-index --stage=2 --temp foo
>> # git checkout-index --stage=3 --temp foo
>> # git diff .merge_x1 .merge_x2
>
> The special ref syntax :<n>:file refers to the blob in stage <n> of the
> index. So you can see them with:
>
>   git show :2:foo
>   git show :3:foo
>
> Or diff them with:
>
>   git diff :2:foo :3:foo
See also

git diff --ours git diff --theirs git diff --base

and man git-diff-files (BTW, it's a pity not to find this in man git-diff).

-- 
Matthieu
Previous: Jeremy Ramer
Message 4 of 4 in “merge conflict diff”
  1. Jeremy RamerApr 3, 2008
  2. Jeff KingApr 3, 2008
  3. Jeremy RamerApr 3, 2008
  4. Matthieu MoyApr 3, 2008

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.