【发布时间】:2014-03-17 00:45:45
【问题描述】:
我如何浅克隆一个 git 存储库,以便我的克隆只包含 1 个历史记录项,并从特定分支开始?
我知道如何进行浅层克隆:
git clone --depth 1 https://path/to/myrepo.git
但不在特定分支上启动克隆。
【问题讨论】:
标签: git continuous-integration git-branch git-clone shallow-clone
我如何浅克隆一个 git 存储库,以便我的克隆只包含 1 个历史记录项,并从特定分支开始?
我知道如何进行浅层克隆:
git clone --depth 1 https://path/to/myrepo.git
但不在特定分支上启动克隆。
【问题讨论】:
标签: git continuous-integration git-branch git-clone shallow-clone
要克隆 repo foo.git 与分支 bar 做:
git clone --depth 1 https://path/to/repo/foo.git -b bar
查看 git-clone 文档:https://www.kernel.org/pub/software/scm/git/docs/git-clone.html
【讨论】:
--no-single-branch 而不是 --no--single--branch。
-b 更详细的版本是--branch