如何克隆一个特定的Git分支?

2022-05-07

以下示例是关于Shell中包含如何克隆一个特定的Git分支?用法的示例代码,想了解如何克隆一个特定的Git分支?的具体用法?如何克隆一个特定的Git分支?怎么用?如何克隆一个特定的Git分支?使用的例子?那么可以参考以下相关源代码片段来学习它的具体使用方法。

[英]:How do I clone a specific Git branch?源码类型:Shell
# syntax
git clone -b <branch> <remote_repo>

# Example
git clone -b my-branch git@github.com:user/myproject.git

# With Git 1.7.10 and later, add --single-branch to prevent fetching of all branches. 
# Example, with OpenCV 2.4 branch:
git clone -b opencv-2.4 --single-branch https://github.com/Itseez/opencv.git

本文地址:https://www.itbaoku.cn/snippets/785165.html