Git merge-base: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Git Commands =Overview= <tt>git merge-base</tt> finds as good common ancestor(s) as possible between two commits...")
 
 
Line 6: Line 6:


<tt>git merge-base</tt> finds as good common ancestor(s) as possible between two commits to use in a three-way merge. <font color=darkgray>One common ancestor is better than another common ancestor if the latter is an ancestor of the former.</font> 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.
<tt>git merge-base</tt> finds as good common ancestor(s) as possible between two commits to use in a three-way merge. <font color=darkgray>One common ancestor is better than another common ancestor if the latter is an ancestor of the former.</font> 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''>

Latest revision as of 16:36, 8 August 2019

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>