在不获取其他分支的情况下增加浅层克隆的深度 [英] Increase depth of shallow clone without fetching other branches

查看:81
本文介绍了在不获取其他分支的情况下增加浅层克隆的深度的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

为了节省磁盘空间,我通常使用浅克隆:

To save disk space, I generally shallow clone:

  • The latest remote git tag
  • The default branch with:

git clone --depth 20 --shallow-submodules --recurse-submodules

如何增加浅克隆的深度?

How do I increase increase the depth of a shallow clone?

注意:我不想增加到完整克隆,我只想加深我已经拥有的东西

Note: I don't want to increase to a full clone, I want to deepen only what I already have.

推荐答案

使用git fetch --deepen=<depth>:

man git-fetch 说:

  --deepen=<depth>
       Similar to --depth, except it specifies the number of commits from
       the current shallow boundary instead of from the tip of each remote
       branch history.

这篇关于在不获取其他分支的情况下增加浅层克隆的深度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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