class Git::Commands::MergeBase

Implements the ‘git merge-base` command to find common ancestors

Finds as good common ancestors as possible for use in a three-way merge. Given two or more commits, it outputs a common ancestor reachable from all of them through the parent relationship.

@example Find merge bases of two branches

merge_base = Git::Commands::MergeBase.new(execution_context)
merge_base.call('main', 'feature')
merge_base.call('main', 'feature', all: true)
merge_base.call('main', 'b1', 'b2', octopus: true)
merge_base.call('main', 'feature', fork_point: true)

@note ‘arguments` block audited against

https://git-scm.com/docs/git-merge-base/2.53.0

@see git-scm.com/docs/git-merge-base git-merge-base

@api private