threads / discuss / 18808

git diff after merge (with conflict)

Subject: git diff after merge (with conflict)

## tl;dr

3 messages between Apr 9, 2009 and Apr 11, 2009.

replies: 2people: 3as markdown or json

layer· Apr 9, 2009, 17:27 UTC · lore

Is there some way to get regular unified diff behavior instead of the combined diff? For certain files (like ChangeLog's) the combined diff format after a merge is *very* confusing.

Thanks.
Kevin
Teemu Likonen· Apr 9, 2009, 17:40 UTC · re: layer · lore

Re: git diff after merge (with conflict)

On 2009-04-09 10:27 (-0700), layer wrote:
> Is there some way to get regular unified diff behavior instead of the
> combined diff? For certain files (like ChangeLog's) the combined diff
> format after a merge is *very* confusing.
Maybe the following commands are helpful:
    git diff --base
    git diff --ours
    git diff --theirs
Those options are not documented in git-diff(1), by the way.
Junio C Hamano· Apr 11, 2009, 00:47 UTC · re: layer · lore

Re: git diff after merge (with conflict)

layer <layer@known.net> writes:
> Is there some way to get regular unified diff behavior instead of the
> combined diff?  For certain files (like ChangeLog's) the combined diff
> format after a merge is *very* confusing.

If you mean the resolution preview (that is you said "after merge with conflict", but what you meant was really "during a merge with conflict, I haven't recorded the final resolution with git-add yet"), I often find these two useful:

	What change does the other branch brought to my tree anyway?
	$ git diff HEAD -- that-file
	What did we do to the other branch?
	$ git diff MERGE_HEAD -- that-file

← back to recent threads