Both glab auth login --hostname gitlab.com --token ... and glab config set token ... --host gitlab.com apply the change to the global ~/.config/glab-cli/config.yml configuration file instead of the local .config/glab-cli/config.yml configuration file.

Checklist

  • I'm using the latest version of the extension (Run glab --version)
    • Extension version: glab version 1.22.0 (2022-01-10)
  • Operating System and version: Windows 10 22H2 version 10.0.19045 N/A Build 19045

Summary

glab config set git_protocol https applies the change to the local .git/glab-cli/config.yml configuration file.

Both glab auth login --hostname gitlab.com --token ceb5c086-50e8-4dfa-a48d-a06616507280 and glab config set token ceb5c086-50e8-4dfa-a48d-a06616507280 --host gitlab.com apply the change to the global ~/.config/glab-cli/config.yml configuration file.

I think this is a bug because it prevents multiple local configurations to use different tokens for the host named gitlab.com

Steps to reproduce

  1. Make backup-copies of your ~/.config/glab-cli/config.yml and .git/glab-cli/config.yml configuration files.
  2. Run the above commands.
  3. Diff the modified configuration files against the saved backup-copies of the configuration files.

What is the current bug behavior?

The token configuration setting is always applied to the global ~/.config/glab-cli/config.yml configuration file

What is the expected correct behavior?

The token configuration settings are applied to the local .git/glab-cli/config.yml configuration file.

Relevant logs and/or screenshots

N/A

Possible fixes

Related

&9363