我如何进行浅拷贝git存储库,以便我的克隆只包含一个历史记录项,并从特定分支开始?
我知道如何进行浅拷贝:
git clone --depth 1 https://path/to/myrepo.git
但不要在特定分支上启动克隆。
我如何进行浅拷贝git存储库,以便我的克隆只包含一个历史记录项,并从特定分支开始?
我知道如何进行浅拷贝:
git clone --depth 1 https://path/to/myrepo.git
但不要在特定分支上启动克隆。
要克隆名为foo.git的存储库并使用分支bar,请执行以下操作:
git clone -b bar foo.git
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
。 - Pedro Oliveira-b
的更详细的版本是--branch
。 - isapir