From: Jeremy Ramer Date: Thu, 03 Apr 2008 14:58:35 GMT Subject: Re: merge conflict diff Message-ID: In-Reply-To: <20080403142649.GA16699@coredump.intra.peff.net> On Thu, Apr 3, 2008 at 8:26 AM, Jeff King wrote: > 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 ::file refers to the blob in stage 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 Perfect! I was not aware of that syntax. That solves the question I asked. > You may also want to look at the git-mergetool script, which uses both > versions (along with the ancestor) as the arguments to many common merge > resolution programs. This suggestion solves the actual problem in a much better way than I was thinking. Thanks for the help!