Find a common parent node for 2 branches

Source: Internet
Author: User

1. Use commands to find directly

If you have branch A and branch B, use the following command "Http://stackoverflow.com/questions/1549146/find-common-ancestor-of-two-branches"

git merge-base A B

You can view the common parent nodes of these 2 branches

CHUCKLU_ZHCN Branch and Master branch are now available

$ git merge-base CHUCKLU_ZHCN Master
4e67f05995b7d615fce1e97f18deb000d367a6f9

$ git show 4e67f05
Commit 4E67F05995B7D615FCE1E97F18DEB000D367A6F9
merge:6d0e241 1583a81
Author:chucklu <[email protected]>
date:wed Sep 2 09:15:08 2015 +0800

Merge branch ' Epix37/master ' into Chucklu/master

2. Use Gitk-all to view directly with the naked eye

It is important to note that the 2 branches you are looking for are in the non-consolidated state to make sense

Otherwise A and B branches, if a branch has already merged the B branch. Then there's no point in finding this parent node.

The parent node must be the last commit of the B branch

Find a common parent node for 2 branches

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.