git clone --depth=1 命令

发现

在看 duubo 官网的使用 , 提供了示例 , git clone 的时候加了 --depth=1 参数 , 不是很熟悉

image-20230512185910273

参数含义

https://cloud.tencent.com/developer/article/2108884

https://www.cnblogs.com/cangqinglang/p/14007741.html

说明:可以看到我们只克隆下包含最近一次commit的一个分支,这样这个项目文件就不会很大

而如果我们想只克隆某个指定分支的最近一次commit,可以使用下面命令

git clone --depth 1  --branch english https://github.com/labuladong/fucking-algorithm.git
Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐