git merge-base

Find a common ancestor of two commits. More information: https://git-scm.com/docs/git-merge-base.

git merge-base {{commit_1}} {{commit_2}}

git merge-base --all {{commit_1}} {{commit_2}}

git merge-base --is-ancestor {{ancestor_commit}} {{commit}}