git如何找出两个分支的共同commit点

git merge-base [-a | --all] <commit> <commit>…​
git merge-base [-a | --all] --octopus <commit>…​
git merge-base --is-ancestor <commit> <commit>
git merge-base --independent <commit>…​
git merge-base --fork-point <ref> [<commit>]

如下图:4,6,7的共同commit点就是2

 

 

参考:https://git-scm.com/docs/git-merge-base

posted @ 2023-04-19 21:31  bf378  阅读(148)  评论(0编辑  收藏  举报