克隆只有一个分支 [英] Clone only one branch

查看:116
本文介绍了克隆只有一个分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道如何克隆只有一个分支,而不是克隆整个Git存储库。 公告 Git 1.7.10 (2012年4月):



  • git clone learn - single-branch 选项来限制克隆到一个分支(惊喜!);没有指向分支历史记录的标签不会被获取。


Git实际上允许您例如:克隆只有一个分支,例如:

  git clone -b mybranch --single-branch git://sub.domain .com / repo.git 

注意你可以添加另一个单独的分支或撤消这个动作。


I would like to know how I could clone only one branch instead of cloning the whole Git repository.

解决方案

From the announcement Git 1.7.10 (April 2012):

  • git clone learned --single-branch option to limit cloning to a single branch (surprise!); tags that do not point into the history of the branch are not fetched.

Git actually allows you to clone only one branch, for example:

git clone -b mybranch --single-branch git://sub.domain.com/repo.git

Note: Also you can add another single branch or "undo" this action.

这篇关于克隆只有一个分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆