gh config set git_protocol https -h github.com

Category: GitHub CLI

gh config set git_protocol https -h github.com

Override git protocol for one host

-h scopes the setting to github.com, so that host uses HTTPS while others keep their own protocol. Host-scoped overrides beat global config for that host. This is how you mix transports across accounts or Enterprise servers.
Looking for more? Search all 7,657 commands — works offline, in English or Spanish, and fixes typos.