我如何浅克隆一个 git 存储库,以便我的克隆仅包含 1 个历史项,并从特定分支开始?
我知道如何进行浅克隆:
git clone --depth 1 https://path/to/myrepo.git
但不在特定分支上启动克隆。
最佳答案
要使用分支 bar 克隆 repo 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
关于git - 如何浅克隆特定分支上的 repo 协议(protocol)?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21833870/