您可以使用以下命令克隆指定分支:
git clone -b <branch-name> <repository-url>
其中,<branch-name>
是要克隆的分支名称,<repository-url>
是要克隆的远程仓库 URL。
例如,如果要克隆名为 develop
的分支,可以运行以下命令:
git clone -b develop https://github.com/username/repository.git
这将从名为 https://github.com/username/repository.git
的远程仓库中克隆 develop
分支。