How to do a “git checkout -b ” from a remote tag

前端 未结 4 645
不知归路
不知归路 2021-02-03 20:32

I\'m trying to create a branch from a remote tag, but it seems there\'s no way to do it. When I try

git checkout -b test origin/deploy

where or

4条回答
  •  天命终不由人
    2021-02-03 20:56

    I'm not sure you can do this directly. You're probably stuck with doing a fetch and then a checkout:

    git fetch origin
    git checkout -b test tag-name
    

    By the way, I wouldn't recommend using a tag name like "deploy".

提交回复
热议问题