Skip to content

Given a Commit object, how do I find out if it is a merge or and ordinary commit ? #1200

Answered by Byron
nyue asked this question in Q&A
Discussion options

You must be logged in to vote

A commit that is a merge has more than one parents, as in len(commit.parents) > 1.

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by Byron
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #1199 on March 13, 2021 16:07.