【发布时间】:2011-09-27 16:39:26
【问题描述】:
我正在尝试从远程标记创建一个分支,但似乎没有办法做到这一点。当我尝试时
git checkout -b test origin/deploy
origin 是远程,deploy 是我想签出的标签,但我得到了
fatal: git checkout: updating paths is incompatible with switching branches.
Did you intend to checkout 'origin/deploy' which can not be resolved as commit?
更新: 我才发现
git fetch --all -t
对我来说不能正常工作。当它下载所有分支时,它不会下载所有标签,所以当我签出部署时,它是旧标签。现在我执行
git fetch --all && git fetch -t
这样当我基于标签创建新分支时
git checkout -b test deploy
新分支与上次部署是最新的。
【问题讨论】:
标签: git git-branch