git how to find commit hash where branch originated from

后端 未结 3 1039
孤城傲影
孤城傲影 2020-12-04 11:14

Pretend I branched from my master branch to a topic branch, and then I did a few commits on my topic branch. Is there a command that tells me the commit hash on the master b

3条回答
  •  臣服心动
    2020-12-04 11:49

    You can use git reflog show --no-abbrev . It will output all changes made to the branch, including it's creation, for example (I created branch xxx from master branch):

    bdbf21b087de5aa2e78a7d793e035d8bd9ec9629 xxx@{0}: branch: Created from master
    

    Note that this is not very reliable as reflog records can expire (90 days by default), and it seems like there is no 100% reliable way to do this.

提交回复
热议问题