Set the default host for gh commands.
Section: Auth, Tokens, and Enterprise
Set default host env var
bash
bash
export GH_HOST=github.example.comExplanation
Set the default host for gh commands.
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
Use GH_ENTERPRISE_TOKEN env var
Authenticate automation against GitHub Enterprise Server using env vars.
Configure Git protocol auth
Configure Git to use GitHub CLI as a credential helper.