git clone -b tag 结果 - 使用 HEAD 警告 : Remote branch not found in upstream origin,

标签 git

如果您尝试使用 -b--branch 克隆标志在单个命令中克隆一个 git 存储库并 checkout 标签:

git clone -b v0.8.2 https://github.com/chaoslawful/lua-nginx-module.git

您可能会遇到如下错误:

warning: Remote branch v0.8.2 not found in upstream origin, using HEAD instead

最佳答案

在版本 1.7.10 之前,git 不支持通过 git clone 调用 checkout 标签。相反,有必要执行:

git clone https://github.com/chaoslawful/lua-nginx-module.git
cd lua-nginx-module
git checkout v0.8.2
cd ..

关于git clone -b tag 结果 - 使用 HEAD 警告 : Remote branch not found in upstream origin,,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17216067/

相关文章:

git - Phoenix 计划如何顺利更名?

git - 如何将提交从 Gerrit 推送到远程存储库?

git - 如何将单个提交归因于多个开发人员?

git - 从项目的旧版本中恢复 git 历史记录

git - 使用 libgit2 高效地获取 git 存储库中的作者列表

git - 标签上的 cherry-pick 会影响后者吗?

eclipse - egit - 未授权

git - 如何从命令行在组织下创建 GitHub 存储库?

ios - Xcode 6 gitignore 文件应该包括什么?

git clone 从防火墙后面的机器到远程机器