In git, how can I find the revision at which a branch was created?

前端 未结 4 1904
臣服心动
臣服心动 2020-12-14 18:55

UPDATE: example repository, https://github.com/so-gitdemo/so-gitdemorepo

In the context of the github repo. How can I easily locate rev \"b0430cee\"? I know I can ju

4条回答
  •  余生分开走
    2020-12-14 19:44

    Since you added a git repo... I worked remotely to get things tested.

    How can I easily locate rev "b0430cee"?

    In that case, this pretty oneliner did the job for me:

    git rev-list --reverse --topo-order --left-right --boundary 1.0...master | 
        grep "^>" -B1 |
        head -1 |
        cut -c2-
    

    If you wanted to get 469c14a1fa8a40237700 (New feature work) instead, this works for me:

    git rev-list --reverse --topo-order --left-right --boundary 1.0...master | 
        grep "^>" |
        head -1 |
        cut -c2-
    

    HTH

提交回复
热议问题