← 返回命令列表

Linux command

gh-config 命令

文本

复制后可按需替换文件名、目录或参数。

常用示例

Get config value

gh config get [key]

Set config value

gh config set [key] [value]

List all configuration

gh config list

Set default editor

gh config set editor [vim]

Set default browser

gh config set browser [firefox]

说明

gh config manages configuration for the GitHub CLI. It controls behavior settings like preferred editor, browser, default prompts, and protocol preferences. Configuration is stored per-host, allowing different settings for github.com and GitHub Enterprise instances. Settings can be environment-specific or global. Common settings include git_protocol (https/ssh), editor, browser, and pager.

参数

get _KEY_
Get a configuration value.
set _KEY_ _VALUE_
Set a configuration value.
list
List all configuration settings.
--host _HOSTNAME_
Apply to specific GitHub host.
--help
Display help information.

FAQ

What is the gh-config command used for?

gh config manages configuration for the GitHub CLI. It controls behavior settings like preferred editor, browser, default prompts, and protocol preferences. Configuration is stored per-host, allowing different settings for github.com and GitHub Enterprise instances. Settings can be environment-specific or global. Common settings include git_protocol (https/ssh), editor, browser, and pager.

How do I run a basic gh-config example?

Run `gh config get [key]` in a terminal, then adjust file names, paths, flags, or remote targets for your system.

What does get _KEY_ do in gh-config?

Get a configuration value.