# Compare two diffs on the command line?

3 messages from 2015-09-04 to 2015-09-04. Participants: Phil Susi, Junio C Hamano.
Thread: https://gitlist.dev/t/40275

## Phil Susi, 2015-09-04 18:00

Subject: Compare two diffs on the command line?
Message-ID: <55E9DC44.90303@ubuntu.com>
URL: https://gitlist.dev/e/55E9DC44.90303%40ubuntu.com

```
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.

```

## Junio C Hamano, 2015-09-04 18:10

Subject: Re: Compare two diffs on the command line?
Message-ID: <CAPc5daVvXNWdAwiNKnQT45p03msTBEyBUq7y+ggRq0e95=_bAQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAPc5daVvXNWdAwiNKnQT45p03msTBEyBUq7y%2BggRq0e95%3D_bAQ%40mail.gmail.com
In-Reply-To: <55E9DC44.90303@ubuntu.com>

```
On Fri, Sep 4, 2015 at 11:00 AM, Phil Susi <psusi@ubuntu.com> wrote:
> 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.

```

## Phil Susi, 2015-09-04 19:23

Subject: Re: Compare two diffs on the command line?
Message-ID: <55E9EFBC.3000800@ubuntu.com>
URL: https://gitlist.dev/e/55E9EFBC.3000800%40ubuntu.com
In-Reply-To: <CAPc5daVvXNWdAwiNKnQT45p03msTBEyBUq7y+ggRq0e95=_bAQ@mail.gmail.com>

```
On 9/4/2015 2:10 PM, Junio C Hamano wrote:
> On Fri, Sep 4, 2015 at 11:00 AM, Phil Susi <psusi@ubuntu.com> wrote:
>> 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.

```
