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

Since installing Git for Windows version 2.41.0.2 I now get a GitHub "Select an account" dialog #4503

Closed
1 task done
cyclr-adrian opened this issue Jul 13, 2023 · 7 comments · Fixed by git-for-windows/build-extra#511
Milestone

Comments

@cyclr-adrian
Copy link

  • I was not able to find an open or closed issue matching what I'm seeing

Setup

  • Which version of Git for Windows are you using? Is it 32-bit or 64-bit?
$ git --version --build-options

git version 2.41.0.windows.2
cpu: x86_64
built from commit: 330483e35cabcdd966e0d4fee29153caaa9a2129
sizeof-long: 4
sizeof-size_t: 8
shell-path: /bin/sh
feature: fsmonitor--daemon
  • Which version of Windows are you running? Vista, 7, 8, 10? Is it 32-bit or 64-bit?
$ cmd.exe /c ver

Microsoft Windows [Version 10.0.22621.1992]
  • What options did you set as part of the installation? Or did you choose the
    defaults?
# One of the following:
> type "C:\Program Files\Git\etc\install-options.txt"
> type "C:\Program Files (x86)\Git\etc\install-options.txt"
> type "%USERPROFILE%\AppData\Local\Programs\Git\etc\install-options.txt"
> type "$env:USERPROFILE\AppData\Local\Programs\Git\etc\install-options.txt"
$ cat /etc/install-options.txt

Editor Option: Notepad++
Custom Editor Path:
Default Branch Option: main
Path Option: Cmd
SSH Option: OpenSSH
Tortoise Option: false
CURL Option: OpenSSL
CRLF Option: CRLFAlways
Bash Terminal Option: MinTTY
Git Pull Behavior Option: Merge
Use Credential Manager: Enabled
Performance Tweaks FSCache: Enabled
Enable Symlinks: Disabled
Enable Pseudo Console Support: Disabled
Enable FSMonitor: Disabled
  • Any other interesting things about your environment that might be related
    to the issue you're seeing?

** insert your response here **

Details

  • Which terminal/shell are you running Git from? e.g Bash/CMD/PowerShell/other

Windows Terminal / PowerShell 7.3.5

git push
  • What did you expect to occur after running these commands?

My code is pushed to GitHub

  • What actually happened instead?

I get the following dialog box:
image

This dialog is new since installed Git for Windows version 2.41.0.2

  • If the problem was occurring with a specific repository, can you provide the
    URL to that repository to help us with testing?

All repos affected.

@rimrul
Copy link
Member

rimrul commented Jul 13, 2023

And did you click on

why am I being asked to select an account?

?

@cyclr-adrian
Copy link
Author

I had 2 options to click on (not sure why) both called Personal Access Token .

I clicked on the first one and then clicked Continue and the command git push was then successful.

I have to do this every time (which is annoying ) I run commands like git push on the command line.

@rimrul
Copy link
Member

rimrul commented Jul 13, 2023

That dialog is indeed new. git-ecosystem/git-credential-manager#1267

I was asking about the blue help link in your screenshot.
That links to https://github.com/git-ecosystem/git-credential-manager/blob/main/docs/multiple-users.md

And that document indeed has a section on how to make GCM pick one account by default.

https://github.com/git-ecosystem/git-credential-manager/blob/main/docs/multiple-users.md#tldr-tell-gcm-to-remember-which-account-to-use

@rimrul
Copy link
Member

rimrul commented Jul 13, 2023

Looking a little further, you might be experiencing git-ecosystem/git-credential-manager#1325

This was fixed with GCM 2.2.2, which will be included in the next release of Git for Windows.

@cyclr-adrian
Copy link
Author

Yes, I think your right that I might be experiencing git-ecosystem/git-credential-manager#1325

I ran:

git credential-manager github list

which returned one item in the list: Personal Access Token.

Then I ran:

git credential-manager github logout "Personal Access Token"

to remove the account.

Then I ran:

git credential-manager github login

and chose the option to authenticate using a browser, which took me to GitHub where I had to authorise the Git Credential Manager as a new OAuth application using my TOTP mobile application.

Then I ran:

git credential-manager github list

which returned one item in the list: {github_username}.

Now when I run:

git push

I no longer get the account selection dialog and the push completes sucessfully.

I'm not sure yet what effect running those commands above will have done to my instance of Visual Studio which also uses GitHub.

@cyclr-adrian
Copy link
Author

cyclr-adrian commented Jul 13, 2023

Found an issue in the documentation so sent a PR to fix it: git-ecosystem/git-credential-manager#1334

@mjcheetham
Copy link
Member

Looking a little further, you might be experiencing git-ecosystem/git-credential-manager#1325

This was fixed with GCM 2.2.2, which will be included in the next release of Git for Windows.

Correct! And 2.41.0(3) was just release in the last moment, which includes the fixed GCM 2.2.2.

https://github.com/git-for-windows/git/releases/tag/v2.41.0.windows.3

@rimrul rimrul closed this as completed Jul 18, 2023
@dscho dscho added this to the v2.41.0(3) milestone Aug 8, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants