Git have merge-base command that show common ancestors of two or more branches.
What analog for Mercurial and bzr?
merged common ancestors: diff3 outputs an additional "middle" section showing the lines as they were in the merge base. This is the starting point for both branches. Criss-cross merge: A merge history where two branches merge into each other in ways that one could not have been a fast-forward merge.
DESCRIPTION. git merge-base finds best common ancestor(s) 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, i.e. a merge base.
3-way merges use a dedicated commit to tie together the two histories. The nomenclature comes from the fact that Git uses three commits to generate the merge commit: the two branch tips and their common ancestor.
The "merge" command is used to integrate changes from another branch. The target of this integration (i.e. the branch that receives changes) is always the currently checked out HEAD branch. While Git can perform most integrations automatically, some changes will result in conflicts that have to be solved by the user.
For Bazaar:
bzr find-merge-base /path/to/branch1 /path/to/branch2
(This command is hidden from the main set of commands that you can obtain with bzr help commands
. Use bzr help hidden-commands
to see other hidden commands).
Use revsets:
"ancestor(single, single)"
Greatest common ancestor of the two changesets.
$ hg log -r 'ancestor(rev1, rev2)'
For Mercurial:
hg debugancestor rev1 rev2
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With