如果您尝试使用 -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/