Skip to contentSkip to conversation

Compare two diffs on the command line?

DISCUSSION Phil Susi 2 participants 3 messages Jun 15, 2016

lore
Share & tools
lore

Phil Susi

author
#0 lore raw

If you have a commit that exists on two branches, in gitk you can mark one, then select the other and choose to compare the two. This results in a diff of the two diffs, rather than a diff between the two trees, which include many other changes that have nothing to do with either commit.

Is there a way to do this on the command line? I thought it would be git diff -c or --cc, but it doesn't seem to filter out all of the other differences between the branches.

#1 lore raw
Quoted 4 lines · Phil Susi

If you have a commit that exists on two branches, in gitk you can mark one, then select the other and choose to compare the two. This results in a diff of the two diffs, rather than a diff between the two trees, which include many other changes that have nothing to do with either commit.

I think you are looking for the interdiff(1) tool.

author
#2 lore raw
Quoted 7 lines · Junio C Hamano
Quoted 4 lines · Phil Susi

If you have a commit that exists on two branches, in gitk you can mark one, then select the other and choose to compare the two. This results in a diff of the two diffs, rather than a diff between the two trees, which include many other changes that have nothing to do with either commit.

I think you are looking for the interdiff(1) tool.

Yes, that is how I would do it before git... I was thinking there would be a git way of doing it, especially since it is there in gitk.