| 用途 | 只要一个分支 |
|---|---|
| 参数 | --single-branch [--branch <名称>] |
| 恢复多分支 | git remote set-branches origin '*' |
常用示例
常用示例
git clone --single-branch -b main https://example.com/org/repo.git
git remote set-branches origin '*'
git fetch origin只读构建场景(CI/发布机)用单分支克隆可以少拉大量引用,注意这正是「只拿需要的」而不是功能受限。