Git merge-base

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.

Internal

Overview

git merge-base finds as good common ancestor(s) as possible between two commits to use in a three-way merge. One common ancestor is better than another common ancestor if the latter is an ancestor of the former. A common ancestor that does not have any better common ancestor is a best common ancestor. That is the merge base. Note that there can be more than one merge base for a pair of commits.

git merge-base <head-branch> <base-branch>