Skip to content

Store gh config in %APPDATA% on windows #1944

Description

@mcorossigo

Describe the bug

When I authenticate in gh with Powershell on Windows 10 it saves variuous files in .config/gh in my user profile folder.
It is expected on Linux, but on Windows I would love to have those files in %APPDATA% (like Github Desktop).

PS C:\Users\user> $PSVersionTable.PSVersion

Major  Minor  Build  Revision
-----  -----  -----  --------
5      1      19041  1
PS C:\Users\user> gh --version
gh version 1.0.0 (2020-09-16)
https://github.com/cli/cli/releases/tag/v1.0.0

Steps to reproduce the behavior

  1. Authenticate
  2. Find files in ~/.config/gh

Expected vs actual behavior

I expect configuration files to be in %APPDATA%/Github Cli when authenticating in Windows enviroment.

Logs

PS C:\Users\user> gh auth status
You are not logged into any GitHub hosts. Run gh auth login to authenticate.
PS C:\Users\user> gh auth login
? What account do you want to log into? GitHub.com
- Logging into github.com
? How would you like to authenticate? Login with a web browser

! First copy your one-time code: F775-F974
- Press Enter to open github.com in your browser...
✓ Authentication complete. Press Enter to continue...

? Choose default git protocol HTTPS
- gh config set -h github.com git_protocol https
✓ Configured git protocol
✓ Logged in as user
PS C:\Users\user> gh auth status
github.com
  ✓ Logged in to github.com as user(~/.config/gh/hosts.yml)
  ✓ Git operations for github.com configured to use https protocol.

Activity

  1. mislav commented on Sep 24, 2020

    @mislav
    Contributor

    Good point; thank you!

    Ref. #554

  2. added
    enhancementa request to improve CLI
    windowsRelated to Windows hosts or runners
    and removed
    bugSomething isn't working
    on Sep 29, 2020
  3. changed the title [-]Authenticating in Windows creates .config in user profile[/-] [+]Store gh config in %APPDATA% on windows[/+] on Sep 29, 2020
  4. Neurognostic commented on Oct 24, 2020

    @Neurognostic

    I would still like gh to respect XDG_CONFIG_HOME and XDG_DATA_HOME in a Windows environment, but to fall back to %APPDATA% and %LOCALAPPDATA% if XDG variables are not set.

  5. just1a-person commented on Dec 23, 2020

    @just1a-person
    Contributor

    I would still like to see config.yml in ~\.config\gh\config.yml

  6. self-assigned this
    on May 19, 2021
  7. added
    coreThis issue is not accepting PRs from outside contributors
    on May 19, 2021
  8. melMass commented on Mar 7, 2024

    @melMass

    For those who find this from google, it wasn't obvious, this now gets installed in :

    C:\Users\User\AppData\Roaming\GitHub CLI\config.yml

  9. bedge commented on Jul 1, 2024

    @bedge

    Anyone brave enough to try symlinking either config.yml or hosts.yml between env's (Windows & WSL)?
    Would be nice to not have WSL mean one has to replicate every cfg dir just because the path format differs.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

coreThis issue is not accepting PRs from outside contributorsenhancementa request to improve CLIwindowsRelated to Windows hosts or runners

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions