From e01871f1c9bd78149c2bb6dfe2ae2630847b6e1f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20M=C3=B6rbitz?= Date: Sun, 11 Dec 2022 02:12:03 +0100 Subject: [PATCH] git-merge-base: add page (#9382) Co-authored-by: Axel Navarro --- pages/common/git-merge-base.md | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 pages/common/git-merge-base.md diff --git a/pages/common/git-merge-base.md b/pages/common/git-merge-base.md new file mode 100644 index 000000000..a374d10d7 --- /dev/null +++ b/pages/common/git-merge-base.md @@ -0,0 +1,16 @@ +# git merge-base + +> Find a common ancestor of two commits. +> More information: . + +- Print the best common ancestor of two commits: + +`git merge-base {{commit_1}} {{commit_2}}` + +- Output all best common ancestors of two commits: + +`git merge-base --all {{commit_1}} {{commit_2}}` + +- Check if a commit is an ancestor of a specific commit: + +`git merge-base --is-ancestor {{ancestor_commit}} {{commit}}`