git how to find commit hash where branch originated from

后端 未结 3 1047
孤城傲影
孤城傲影 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:35

    The only 100% reliable way to do this is to tag the beginning of your branch when you create it. The accepted answer will not work if you merge commits back to the branch you originated your new branch from. This is sometimes done for example if you are creating a stabilizing release branch and want to merge back your fixes you find during release testing back to master. A common thing to do. If you know you will never merge commits from your new branch back to the originating branch then the accepted answer will work.

提交回复
热议问题