68 个 登录

九库查询/Git 命令速查/git clone --depth 1

git clone --depth 1

只拉最近一次提交的浅克隆

Git 命令速查 更新 2026-11-16
分组
仓库初始化
命令
git clone --depth 1
示例
git clone --depth 1 --branch main https://example.com/repo.git

速度快、占空间小,适合 CI 和只看最新代码。代价是历史不全、blame 与 log 受限;需要完整历史时用 git fetch --unshallow 补回。

数据来源:Git 官方文档整理。内容存于数据库,更新日期 2026 年 11 月 16 日。