Skip to content

How do I ensure gh doesn't use ~/.config/gh/config.yml? #7435

Answered by mislav
sheldonhull asked this question in Q&A
Discussion options

You must be logged in to vote

You can use gh auth login --secure-storage, which is now the default behavior even if you don't pass that flag. That will still write host information to either config.yml or hosts.yml, but won't save your token there, and instead save it to Keychain on macOS, "wincred" on Windows, or Secret Service (e.g. Gnome keyring) on Linux. This will typically only work on computers with a graphical desktop environment installed.

In all other environments you can manually set the GH_TOKEN environment variable with a Personal Access token you've generated yourself. In that case, gh will only read from the environment variable and not from config.yml or hosts.yml.

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@sheldonhull
Comment options

@sheldonhull
Comment options

@mislav
Comment options

@zimmerman-pliant
Comment options

Answer selected by sheldonhull
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants