John Wick
John Wick

Reputation: 745

Is there a way to tell if a GIT commit is a merge?

Is it possible to determine whether a commit (or md5hash value) is a "merge" from a developer branch to a parent branch? (i.e. master)

Thanks in advance.

Upvotes: 1

Views: 651

Answers (2)

eftshift0
eftshift0

Reputation: 30204

Sure, just check how many parents it has:

git show --pretty=%ph --quiet some-brach-or-commit

If more than one parent shows up, it's a merge commit.

Upvotes: 2

Tsvetoslav Tsvetkov
Tsvetoslav Tsvetkov

Reputation: 1176

You can use ether UI or git log on master that will show you a list of all the commits made to a repository and search for your commit

Upvotes: 0

Related Questions