使用GitHub CLI克隆特定的存储库分支



我正试图克隆GitHub存储库的一个特定分支("dev"分支(。使用git命令,我可以运行类似的程序

git clone --branch dev https://github.com/user/repo

gh(GitHub CLI(中与此等效的内容是什么?我在文档中找不到

你可以试试这个:

git clone link_repo -b branch_name --single-branch

在您的情况下,我们使用cmd:

git clone https://github.com/user/repo -b dev --single-branch

尝试以下命令克隆特定的branch

git clone --single-branch --branch <branch-name> <url>

示例:

git clone --single-branch --branch dev https://github.com/test-repo.git

其中,devbranch的名称。

https://github.com/test-repo.git是url。

最新更新