【发布时间】:2013-04-12 12:03:06
【问题描述】:
我想使用特定标签将远程树同步到我的本地机器。使用 git checkout 以外的标签同步树的最佳方法是什么。因为如果我使用 git checkout 我需要为每个 repo 同步最新的树顶部和然后结帐到该特定标签。
【问题讨论】:
标签: git repository
我想使用特定标签将远程树同步到我的本地机器。使用 git checkout 以外的标签同步树的最佳方法是什么。因为如果我使用 git checkout 我需要为每个 repo 同步最新的树顶部和然后结帐到该特定标签。
【问题讨论】:
标签: git repository
你可以先做一个:
git fetch ; git fetch --tags
(2 次获取,只是为了确保获得所有次提交:请参阅“Does “'git fetch --tags'” include “'git fetch`'?”)
它不会更新您的本地工作树(与 git pull 相反)。
从那里,您可以执行以下操作:
git checkout aTag
(有效,但让您处于DETACHED HEAD 模式)
【讨论】:
git fetch --tags
你可以使用
repo init -u <path to manifest repo> -m <manifest name> -b refs/tags/<tag_name>
【讨论】: