gh config set git_protocol ssh

Category: GitHub CLI

gh config set git_protocol ssh

Set git protocol to SSH

Writes git_protocol ssh into gh's config so git clone and push use SSH URLs, which need an SSH key set up on GitHub. The other value is https. Your existing remotes are not rewritten by this setting.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.