在GIT中进行浅表克隆时,仅检索到一个分支 [英] Only one branch is retrieved when shallow clone is made in GIT

查看:61
本文介绍了在GIT中进行浅表克隆时,仅检索到一个分支的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试缩小大型存储库以减少服务器负载.我正在使用命令

I'm trying to shrink a big repository to reduce server load. I'm using the command

git clone --depth 1000 url

但是克隆完成后,我只有一个分支.未克隆的分支是新分支(大约3周),克隆的历史记录有3个月,因此这些分支必须在该历史记录内.如果我尝试使用

But when the clone is finished I only have one branch. The branches not cloned are new (3 weeks or so) and the history cloned has 3 months, so those branches has to be inside that history. If I try to search all branches with

git branch -a 

仅显示一个分支.

有什么想法吗? 预先感谢!

Any ideas? Thanks in advance!

推荐答案

浅层克隆默认只获得一个分支.如果要获取所有分支,请将--no-single-branch传递给git clone.

Shallow clones default to only getting a single branch. If you want to get all branches, pass --no-single-branch to git clone.

这篇关于在GIT中进行浅表克隆时,仅检索到一个分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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