Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Store gh config in %APPDATA% on windows #1944

Closed
mcorossigo opened this issue Sep 24, 2020 · 4 comments · Fixed by #3671
Closed

Store gh config in %APPDATA% on windows #1944

mcorossigo opened this issue Sep 24, 2020 · 4 comments · Fixed by #3671
Assignees
Labels
core This issue is not accepting PRs from outside contributors enhancement a request to improve CLI windows

Comments

@mcorossigo
Copy link

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.
@mcorossigo mcorossigo added the bug Something isn't working label Sep 24, 2020
@mislav
Copy link
Contributor

mislav commented Sep 24, 2020

Good point; thank you!

Ref. #554

@vilmibm vilmibm added enhancement a request to improve CLI help wanted Contributions welcome windows and removed bug Something isn't working labels Sep 29, 2020
@vilmibm vilmibm changed the title Authenticating in Windows creates .config in user profile Store gh config in %APPDATA% on windows Sep 29, 2020
@Neurognostic
Copy link

Neurognostic commented Oct 24, 2020

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.

@mislav mislav mentioned this issue Nov 24, 2020
8 tasks
@just1a-person
Copy link
Contributor

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

@vilmibm vilmibm mentioned this issue Apr 27, 2021
18 tasks
@samcoe samcoe self-assigned this May 19, 2021
@samcoe samcoe removed the help wanted Contributions welcome label May 19, 2021
@vilmibm vilmibm added the core This issue is not accepting PRs from outside contributors label May 19, 2021
@melMass
Copy link

melMass commented Mar 7, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core This issue is not accepting PRs from outside contributors enhancement a request to improve CLI windows
Projects
None yet
Development

Successfully merging a pull request may close this issue.

8 participants
@mislav @vilmibm @melMass @samcoe @Neurognostic @mcorossigo @just1a-person and others