You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

如何使用GitHub CLI(gh)克隆GitHub仓库的指定dev分支?

GitHub CLI 克隆指定分支的等价命令

对应你给出的 Git 命令 git clone --branch dev https://github.com/user/repo,GitHub CLI(gh)的等价命令是:

gh repo clone user/repo --branch dev

也可以用短参数 -b 简化写法:

gh repo clone user/repo -b dev

使用 gh repo clone 时无需输入完整的 HTTPS 仓库地址,只需要提供「用户名/仓库名」的格式即可,CLI 会自动完成地址解析。

内容的提问来源于stack exchange,提问作者Fral

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.16 00:15:43