Set the preferred Git protocol used by gh.
Section: Auth, Tokens, and Enterprise
Set git protocol to ssh
bash
bash
gh config set git_protocol sshExplanation
Set the preferred Git protocol used by gh.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Auth, Tokens, and Enterprise
Configure Git protocol auth
Configure Git to use GitHub CLI as a credential helper.
Authenticate with token from stdin
Authenticate non-interactively using a token piped from stdin.
Use GH_ENTERPRISE_TOKEN env var
Authenticate automation against GitHub Enterprise Server using env vars.