From git-clone(1) 手册页 http://git-scm.com/docs/git-clone
--branch
还可以在结果存储库中的该提交处获取标签并分离 HEAD。
我试过
git clone --branch <tag_name> <repo_url>
但这不起作用。它返回:
warning: Remote branch 2.13.0 not found in upstream origin, using HEAD instead
如何使用这个参数?
git clone --depth 1 --branch <tag_name> <repo_url>
--depth 1
是可选的,但如果您只需要该修订版的状态,您可能希望跳过下载该修订版之前的所有历史记录。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)