是否可以在精简模式下克隆存储库以节省磁盘空间?

时间:2017-01-31 02:21:09

标签: git

我想克隆这个存储库,但它是一个庞大的仓库,在我的硬盘上占用1 GB。

是否存在克隆存储库的“精简”方式,它不存储历史信息和完整历史记录?

1 个答案:

答案 0 :(得分:3)

您可以通过git clone

的--depth选项指定克隆深度
 --depth <depth>
       Create a shallow clone with a history truncated to the 
       specified number of revisions. A shallow repository has
       a number of limitations (you cannot clone or fetch from
       it, nor push from nor into it), but is adequate if
       you are only interested in the recent history of a large 
       project with a long history, and would want to send in 
      fixes as patches.