How do I ensure gh
doesn't use ~/.config/gh/config.yml
?
#7435
-
I've explicitly disabled and blocked this directory as I didn't want it writing plain text token information again. I setup git credential manager and set it to use this:
I also exited the git daemon processes and reloaded in a new terminal and authenticated after getting the expected git credential manager prompt for web/token. I can't get |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
You can use In all other environments you can manually set the |
Beta Was this translation helpful? Give feedback.
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 eitherconfig.yml
orhosts.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 fromconfig.yml
orhosts.yml
.