简体   繁体   English

从GIT克隆分支

[英]clone a branch from GIT

I want to check out OpenStack Neutron's branch JUNO from the git repository. 我想从git存储库中签出OpenStack Neutron的分支JUNO。 What is the right URI to do this? 正确的URI是什么? If I do 如果我做

% git clone git://github.com/openstack/neutron/tree/stable/juno/

it says: 它说:

openstack/neutron/tree/stable/juno is not a valid repository name

However I do see this branch at https://github.com/openstack/neutron/tree/stable/juno/ . 但是我确实在https://github.com/openstack/neutron/tree/stable/juno/看到了这个分支。 What am I doing wrong? 我究竟做错了什么? Thanks. 谢谢。

You don't clone a branch, you clone an entire project: 您不克隆分支,而是克隆整个项目:

$ git clone git://github.com/openstack/neutron
Cloning into 'neutron'...
remote: Counting objects: 105856, done.
remote: Total 105856 (delta 0), reused 0 (delta 0)
Receiving objects: 100% (105856/105856), 44.17 MiB | 1.06 MiB/s, done.
Resolving deltas: 100% (68444/68444), done.

After doing that, you can simply check out the branch you're interested in. Eg: 完成之后,您可以简单地签出您感兴趣的分支。例如:

$ git checkout -b juno -t origin/stable/juno
Branch juno set up to track remote branch stable/juno from origin.
Switched to a new branch 'juno'

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM