git-merge-base: add page (#9382)

Co-authored-by: Axel Navarro <navarroaxel@gmail.com>
pull/1/head
Richard Mörbitz 2022-12-11 02:12:03 +01:00 committed by GitHub
parent 0719148920
commit e01871f1c9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1,16 @@
# git merge-base
> Find a common ancestor of two commits.
> More information: <https://git-scm.com/docs/git-merge-base>.
- 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}}`