如何克隆一个特定版本的git仓库? [英] How to clone a specific version of a git repository?
本文介绍了如何克隆一个特定版本的git仓库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
如何克隆存储库的特定版本?
我正在与symfony2一起工作,并且希望备份我的供应商以防github无法访问。 / p>
我想在vendor-file的帮助下备份存储库。
语法如下所示:
[symfony]
git = http://github.com/symfony/symfony.git
版本= v2.0.9
现在我该如何告诉git获取特定版本?是否有像下面这样的终端命令:
git clone --mirror http://github.com/symfony/symfony.git --version = v2.0.9
在此先感谢
<$ c $ =h2_lin>解决方案
我会告诉git使用这个确切版本。 c> git clone http://github.com/symfony/symfony.git
cd symfony
git checkout v2.0.9
一行:
git clone http:// github。 com / symfony / symfony.git -b v2.0.9
I'm working with symfony2 and I want to backup my vendors in case github is not reachable.
How do I clone a specific Version of a repository?
I want to backup the repositories with help of the vendors-file.
the syntax is something like this:
[symfony]
git=http://github.com/symfony/symfony.git
version=v2.0.9
now how do I tell git to get that specific version? Is there a terminal-command like:
git clone --mirror http://github.com/symfony/symfony.git --version=v2.0.9
Thanks in Advance
解决方案
What I would do to tell git to use this exact version is:
git clone http://github.com/symfony/symfony.git
cd symfony
git checkout v2.0.9
One liner:
git clone http://github.com/symfony/symfony.git -b v2.0.9
这篇关于如何克隆一个特定版本的git仓库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文