使用Github CLI克隆存储库是否使用HTTPS或SSH?

问题描述

我是GitHub组织的成员,该组织要求通过SSH进行推送,因此在克隆存储库时,我需要使用语法git clone git@github.com:<ORG>/<REPO>.git

我现在正越来越多地迁移到使用GitHub CLI,并且刚刚注意到GitHub上的新(ish)选项“使用GitHub CLI克隆”(gh repo clone <ORG>/<REPO>)。是否使用SSH或HTTPS进行克隆?据我所知,the official docs未指定。

解决方法

进一步挖掘显示the default git_protocol is HTTPS

您可以将其替换为默认情况下与gh config set git_protocol ssh一起使用ssh,并通过查看gh config get git_protocol的输出来检查它是否起作用。

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...