Command

git merge-base

Find a best common ancestor for two commits. Complex histories may have multiple best common ancestors.

Formal Syntax & Structure

git syntaxgit
git merge-base <commit> <commit>

Working Example

Example Snippetgit
git merge-base main feature
Git Reference