1

I am a member of a GitHub org that requires pushes to be done through SSH, so when I clone down repos I need to use the syntax git clone git@github.com:<ORG>/<REPO>.git.

I am migrating over to using the GitHub CLI more and more now, and have just noticed the new(ish) option on GitHub to "Clone with GitHub CLI" (gh repo clone <ORG>/<REPO>). Does this use SSH or HTTPS to clone? As far as I can tell, the official docs don't specify.

James Whiteley
  • 3,363
  • 1
  • 19
  • 46

1 Answers1

2

Further digging shows that the default git_protocol is HTTPS.

You can override this to use ssh by default with gh config set git_protocol ssh and check that it has worked by viewing the output of gh config get git_protocol.

James Whiteley
  • 3,363
  • 1
  • 19
  • 46