# What changed in merge commit?

5 messages from 2011-07-18 to 2011-07-18. Participants: Patrick Doyle, Erik Faye-Lund, Christof Krüger, Andreas Schwab.
Thread: https://gitlist.dev/t/27846

## Patrick Doyle, 2011-07-18 16:44

Subject: What changed in merge commit?
Message-ID: <CAF_dkJC-ee2Bqyi2_Fx_j8mu3tCFsV8o=xMRLjx+s2di4=HfkQ@mail.gmail.com>
URL: https://gitlist.dev/e/CAF_dkJC-ee2Bqyi2_Fx_j8mu3tCFsV8o%3DxMRLjx%2Bs2di4%3DHfkQ%40mail.gmail.com

```
Since today seems to be my day to hang out on this list, I thought I'd
ask another burning question...

How can I see what changed in a merge commit?

$ git log

just says "merge remote branch 'origin/master' into wpd" and

$ git log --name-status

says the same thing -- it doesn't list any files as having changed.

Perhaps nothing changed between the last time I merged with
origin/master and the current time.  I know that at least one change
was committed.  I suppose it's possible that two (or more) changes
were committed, undoing that one change.  (But I don't think that's
likely).

I could go back and look at the log for origin/master... and I'm sure
there's some way to say "just give me the log of changes since the
last time I merged", or more to the point now, "just give me the log
of changes since the time before the last time I merged".  It probably
has something to do with a couple of ref names, a caret, and some
dots, but I get lost in all of that syntax.

Thanks for the tips.

--wpd

```

## Erik Faye-Lund, 2011-07-18 16:52

Subject: Re: What changed in merge commit?
Message-ID: <CABPQNSaOQxBqf34_799zc46EnHsc7L3BiSATyYq+Q6oGs0H6sw@mail.gmail.com>
URL: https://gitlist.dev/e/CABPQNSaOQxBqf34_799zc46EnHsc7L3BiSATyYq%2BQ6oGs0H6sw%40mail.gmail.com
In-Reply-To: <CAF_dkJC-ee2Bqyi2_Fx_j8mu3tCFsV8o=xMRLjx+s2di4=HfkQ@mail.gmail.com>

```
On Mon, Jul 18, 2011 at 6:44 PM, Patrick Doyle <wpdster@gmail.com> wrote:
> Since today seems to be my day to hang out on this list, I thought I'd
> ask another burning question...
>
> How can I see what changed in a merge commit?
>
> $ git log
>
> just says "merge remote branch 'origin/master' into wpd" and
>
> $ git log --name-status
>
> says the same thing -- it doesn't list any files as having changed.

That's because nothing did change; it's the merge's parents that are
the commits that changed something. If there was a fix-up (either due
to a merge-conflict or an explicitly squashed-in change), then that
would show up for the merge-commit.

You probably want to do something like "git diff SHA1-OF-MERGE^
SHA1-OF-MERGE" to see what the merge changed compared to it's previous
commit.

```

## Christof Krüger, 2011-07-18 17:10

Subject: Re: What changed in merge commit?
Message-ID: <1311009024.18226.121.camel@oxylap>
URL: https://gitlist.dev/e/1311009024.18226.121.camel%40oxylap
In-Reply-To: <CABPQNSaOQxBqf34_799zc46EnHsc7L3BiSATyYq+Q6oGs0H6sw@mail.gmail.com>

```
On Mo, 2011-07-18 at 18:52 +0200, Erik Faye-Lund wrote:
> You probably want to do something like "git diff SHA1-OF-MERGE^
> SHA1-OF-MERGE" to see what the merge changed compared to it's previous
> commit.
You could also use "git log --name-status -m" which will show multiple
entries for each parent of the merge commit.
See "man git-diff-tree" and look for the description of the options -m,
-c and --cc

Bye,
  Chris

```

## Patrick Doyle, 2011-07-18 17:25

Subject: Re: What changed in merge commit?
Message-ID: <CAF_dkJCvNHWYfjmF8bX5CT+wyQ9ftvN7aAr0FBeg5ZQ7BSuyUA@mail.gmail.com>
URL: https://gitlist.dev/e/CAF_dkJCvNHWYfjmF8bX5CT%2BwyQ9ftvN7aAr0FBeg5ZQ7BSuyUA%40mail.gmail.com
In-Reply-To: <1311009024.18226.121.camel@oxylap>

```
2011/7/18 Christof Krüger <git@christof-krueger.de>:
> You could also use "git log --name-status -m" which will show multiple
> entries for each parent of the merge commit.
> See "man git-diff-tree" and look for the description of the options -m,
> -c and --cc

Thanks...

$ git log --name-status -m --first-parent

is what I was looking for.  I thought I recalled there being something
like that, but could not recall nor find on the git-log man page the
"-m" option.  Of course I can see it now :-)

Thanks for pointing me in the right direction.

--wpd

```

## Andreas Schwab, 2011-07-18 20:39

Subject: Re: What changed in merge commit?
Message-ID: <m24o2jfhn0.fsf@igel.home>
URL: https://gitlist.dev/e/m24o2jfhn0.fsf%40igel.home
In-Reply-To: <CAF_dkJC-ee2Bqyi2_Fx_j8mu3tCFsV8o=xMRLjx+s2di4=HfkQ@mail.gmail.com>

```
Patrick Doyle <wpdster@gmail.com> writes:

> How can I see what changed in a merge commit?

`git show -m' will show a diff for each parent. See "Diff Formatting" in
git-log(1).

Andreas.

-- 
Andreas Schwab, schwab@linux-m68k.org
GPG Key fingerprint = 58CA 54C7 6D53 942B 1756  01D3 44D5 214B 8276 4ED5
"And now for something completely different."

```
