“git checkout tag-name” vs “git reset --hard tag-name”

前端 未结 1 1451
闹比i
闹比i 2021-02-05 09:13

I know that there are questions like this, but that\'s not what I\'m asking.

I also know that:

git checkout tag-name:

  • Detaches you fro
相关标签:
1条回答
  • 2021-02-05 10:06

    I wonder which one makes more sense for updating to a tag

    Your production install should be checking out a tag.

    Think of it this way: your production install is read-only. git reset --hard tag-name will modify the currently checked out branch.

    Alternatively

    It's common practice that in addition to creating a tag, you have one branch which is simply the latest release. In which case you'd e.g. merge to master and create a tag from there; and on your production installs you'd update simply with git pull (on master).

    0 讨论(0)
提交回复
热议问题