Git - how to find first commit of specific branch

后端 未结 7 456
长发绾君心
长发绾君心 2020-11-30 18:35

In following example tree:

A-B-C-D-E (master branch)
    \\
     F-G-H (xxx branch)

I\'m looking for F - the first commit in xxx branch. I

7条回答
  •  囚心锁ツ
    2020-11-30 19:08

    git cherry master -v | tail -1   
    

    however this will only give you the first commit on branch xxx that is not in master, not the first commit on branch xxx ever. the latter would be difficult if branch xxx has been deleted and/or re-created one or more times. it that case you could try the following:

    git reflog | grep checkout | grep xxx | tail -1   
    

提交回复
热议问题