| 用途 | 限制克隆深度、减少耗时 |
|---|---|
| 语法 | git clone --depth <N> <URL> |
| 补历史 | git fetch --unshallow 或 --depth 加深 |
常用示例
常用示例
git clone --depth 1 https://github.com/org/repo.git
git clone --depth 50 --no-single-branch https://github.com/org/repo.git
git fetch --depth 200 # 在浅克隆里继续加深
git fetch --unshallow # 补全为完整仓库浅克隆下 git log/blame/bisect 与合并基线分析可能不准确;需要评审历史或定位回归时先补全历史。