问题描述
我是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
的输出来检查它是否起作用。