Finding a branch point with Git?

前端 未结 22 1328
小鲜肉
小鲜肉 2020-11-22 10:11

I have a repository with branches master and A and lots of merge activity between the two. How can I find the commit in my repository when branch A was created based on mast

22条回答
  •  感情败类
    2020-11-22 10:38

    You could use the following command to return the oldest commit in branch_a, which is not reachable from master:

    git rev-list branch_a ^master | tail -1
    

    Perhaps with an additional sanity check that the parent of that commit is actually reachable from master...

提交回复
热议问题