threads / discuss / 52561

What the meaning of two commit ID in a merge commit's log

Subject: What the meaning of two commit ID in a merge commit's log

## tl;dr

2 messages between Jan 4, 2020 and Jan 4, 2020.

replies: 1people: 2as markdown or json

wuzhouhui· Jan 4, 2020, 01:18 UTC · lore
Hi,

When I use "git log" to display commit log, I see there are two commit IDs in a merge commit, e.g.

    commit 2187f215ebaac73ddbd814696d7c7fa34f0c3de0
    Merge: 2d3145f8d280 fbd542971aa1
    Author: Linus Torvalds <torvalds@linux-foundation.org>
    Date:   Tue Dec 17 13:27:02 2019 -0800
        Merge tag 'for-5.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux

In the previous example, we can see two commit IDs: 2d3145f8d280 and fbd542971aa1. So, what's the meaning of them, precisely.

Thanks
brian m. carlson· Jan 4, 2020, 04:08 UTC · re: wuzhouhui · lore

Re: What the meaning of two commit ID in a merge commit's log

On 2020-01-04 at 01:18:58, wuzhouhui wrote:
Show 14 quoted lines
> Hi,
> 
> When I use "git log" to display commit log, I see there are
> two commit IDs in a merge commit, e.g.
> 
>     commit 2187f215ebaac73ddbd814696d7c7fa34f0c3de0
>     Merge: 2d3145f8d280 fbd542971aa1
>     Author: Linus Torvalds <torvalds@linux-foundation.org>
>     Date:   Tue Dec 17 13:27:02 2019 -0800
> 
>         Merge tag 'for-5.5-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux
> 
> In the previous example, we can see two commit IDs: 2d3145f8d280 and
> fbd542971aa1. So, what's the meaning of them, precisely.

Non-merge commits have a single parent commit that they're based on (unless they're a root commit). Merge commits, since they merge two (or more) separate lines of development, contain multiple parent commits (usually, but not always, two). So the two commit IDs here are the two parent commits of this merge.

-- 
brian m. carlson: Houston, Texas, US
OpenPGP: https://keybase.io/bk2204

← back to recent threads