Skip to contentSkip to conversation

git diff after merge (with conflict)

DISCUSSION layer 3 participants 3 messages Jun 15, 2016

lore
Share & tools
lore

layer

author
#0 lore raw

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

#1 lore raw
Quoted 3 lines · layer

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

#2 lore raw
In reply to layer
Quoted 3 lines · layer

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.