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

前端 未结 4 1884
臣服心动
臣服心动 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:24

    It's very easy to add tags retroactively in git. All you need to do is to give the sha1 hash to git tag command (thanks Sehe):

    git tag 1.0 abcd1232
    git push origin 1.0
    

    Hard to answer your second question since it's hard to define what is "best". At work we have a develop branch that everyone work against and when we decide that we want to release, we create a release branch, e.g. rel-1.0 and that branch lives until we decide that we are done with it. Then we merge it into master, tag with 1.0 and delete the release branch. So a tag for us should always be regarded as holy and as stabile as it can get. So in our case it's always the merge commit that is created when we merge the release branch into master.

提交回复
热议问题