Git - how to find first commit of specific branch

后端 未结 7 457
长发绾君心
长发绾君心 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:14

    git log master..branch --oneline | tail -1
    

    Where "branch" is your specific branch name. The dot-dot gives you all of the commits that the branch has that master doesn't have. tail -1 returns the last line from the previous output.

提交回复
热议问题