要克隆指定分支的代码,可以使用以下命令:
git clone -b branch_name git_repo_url
其中,branch_name为要克隆的分支名称,git_repo_url为远程代码仓库的地址。
例如,要克隆名为develop的分支代码,可以使用如下命令:
git clone -b develop https://github.com/user/repo.git
这将会把https://github.com/user/repo.git仓库的develop分支克隆到本地。