-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Select an account prompt showing duplicate "Personal Access Token" options when Visual Studio is also signed-in with GitHub #1325
Comments
Same issue. Looks like I got updated to 2.2.1 released on July 5: Could it have regressed something? |
@mjcheetham could this be a regression? This dialog started showing up today. I work for Microsoft and have Microsoft and other orgs access if that matters. This dialog disrupts the workflow and the UX is poor (which PAT is which?). How do I view more info about these PATs and perhaps delete one of them? |
Hi @KirillOsenkov, I assume you're on Windows here? Can you please run the following command to see what these credentials are: cmdkey /list:git* Example output: Currently stored credentials for git*:
Target: git:https://github.com/
Type: Generic
User: mattche_microsoft
Local machine persistence
Target: git:https://bitbucket.org/
Type: Generic
User: mjcheetham
Local machine persistence
Target: git:https://bitbucket.org/refresh_token
Type: Generic
User: mjcheetham
Local machine persistence
Target: git:https://gitlab.com/
Type: Generic
User: oauth2
Local machine persistence
Target: git:https://oauth-refresh-token.gitlab.com/
Type: Generic
User: oauth2
Local machine persistence
Target: git:https://mjcheetham@github.com/
Type: Generic
User: mjcheetham
Local machine persistence Are you using Visual Studio? Did you first clone/interact with a GitHub repository from inside of Visual Studio or from the terminal (since the OS was first installed)? |
I'm having this issue as well without multiple access tokens I have the github plugin installed in VS; I'm guessing this is what's up (excerpted from cmdkey). It started happening this week.
|
Hello all! Thanks for your patience with this problem. We have now identified the cause of the issue, and have a fix. The recently added support for multiple accounts in GCM is erroneously detecting duplicate credentials when Visual Studio has a signed-in GitHub account. Selecting either of the options listed "Personal Access Token" will allow the Git operation you are running to proceed, but we appreciate this is a frustrating interruption. We are working on getting out a new release of GCM, and subsequently Git for Windows (that bundles GCM) with a fix to this issue. In the meantime, there are a few workarounds:
|
Great! That was quick looking forward to see to update :) |
…redential Manager (#1328) GCM by default creates entries in the Windows Credential Manager on Windows, and prefixes the 'target name' of the entry with "git:". This 'namespace' prefix is configurable, but is not often changed in practice outside of tests. Visual Studio, when adding GitHub accounts (either natively or by the older GitHub extension for VS), it creates three credential entries: 1. GitHub for Visual Studio - https://github.com 2. git:https://github.com 3. https://github.com Entry 1 is used by VS for it's own purposes. Entry 2 is created for the benefit for GCM, so that we are 'primed'. It is unknown what entry 3 is for at this time. There is an error in our existing logic for enumerating credentials that is also matching entry 3 as well as the expected entry 2. Modify and fix the matching logic to ensure that the namespace prefix matches, rather than just stripping it and matching (even if it doesn't exist!). Fixes #1325 --- **Bug repro instructions:** 1. Open Visual Studio 2. File > Account Settings 3. Add a GitHub account 4. Open a terminal (inside or outside of VS) and attempt to clone/fetch/push to or from a private GitHub repository. At this point a window should appear asking you to select between two "Personal Access Token" accounts. After installing [the bits from this PR build (artifacts > win-x86)](https://github.com/git-ecosystem/git-credential-manager/pull/1328/checks), attempting step 4 should **no longer** result in a prompt to select between two "Personal Access Token" accounts.
We've now merged in the fix to I will update this issue once the release is complete. |
**Changes since 2.2.1:** - Fix an issue where duplicate "Personal Access Token" GitHub account options are shown when Visual Studio has a GitHub account signed-in (#1325 #1328) - Fix an issue with Azure DevOps Server (TFS) and Windows Integrated Authentication (#1331 #1332) - Fix an issue with OAuth redirects GitHub Enterprise Server (#1329 #1330) - Correctly handle non-ASCII username/passwords with the WPF UI helpers (#1287 #1326)
Hello all! Git for Windows 2.41.0(3) has just been released in the last few minutes: https://github.com/git-for-windows/git/releases/tag/v2.41.0.windows.3 This release includes GCM 2.2.2 that fixes this issue. |
Hi all |
Still getting the issue as well with git version 2.41.0.windows.3 whenever I fetch with vscode. |
Updated to git version 2.41.0.windows.3 and I'm still getting the duplicated account when using VSCode to sync changes with GitHub repos. |
@mjcheetham I'm no longer seeing the account selection dialog. Thanks! |
Additionally, I had to open the Windows Credential Manager and delete the GitHub credential. When calling |
Yep. That's done the trick. Thanks |
I'm still confused about how to resolve this. After reading through this thread a few times, here's what I've tried:
I've seen at least one comment saying I need to "delete the GitHub" credential as if there's only one. In Windows Credential Manager (which I didn't know was a thing until tonight), I see two possibly relevant entries:
Am I supposed to delete one or both of those? The screenshot upthread seems to suggest I should keep those and instead delete I currently have only one GitHub account, and it's the only one I've ever used from this machine. So it's not clear to me why I even have two credentials for GitHub. I vaguely recall having trouble setting up a personal access token way back when, so I don't relish having to figure out that process again. What's my next step? |
I am using WSL and I had to run this command from the WSL prompt to keep the dialog from popping up:
Never mind, that did not work. I am still getting the popups in WSL (with Visual Studio Code). |
@RobCannon - can you please open a WSL terminal, run the below command, and share the output here?
|
The likely reason you are seeing these two entries is because the The easiest thing to do here for you is to delete both |
tl;dr: It seems to have worked. Thanks! I'm still rather confused, though.
Neither of the user names for me were "Personal Access Token." In my case, the "Select an Account" dialog kept asking me to choose between "aidtopia" and "aidtopia".
Well, the process starts on the command line, but it sends you to the browser, which eventually directs to a localhost address. Between that blank page and the command line instructing me to complete authentication via the browser, I naturally concluded something had gone wrong. But, no, that's apparently what success looks like! Who knew? |
I could not fix this (by upgrading git & removing my credentials and reauthenticating) until I did that plus uninstall VS Code. UPDATE: Ignore this. It was gone for 12 hours after doing this, and now the duplicate account and dialog is back. Not sure what to try now. |
Here is my git config from WSL:
|
OK, now I am no longer getting the duplicate account dialog, but I get the authenticate dialog (which ends opens up a browser window to authenticate) every few minutes. ARGHH!!! |
Even after running The next time I needed credentials, I had to relog using the browser (once), that was it So yeah, this was not fixed by an update, I had to do manual intervention and I'm likely not the only one still affected |
OK, everything has been working fine this morning. I re-cloned my repos without specifying the userid in the url (as was suggested somewhere) and I have not seen a dialog since. Hopefully that will continue through the whole day. For anyone using WSL, yesterday (suddenly) WSL was unable to execute Windows executables and that resulted in a an error calling git-credential-manager.exe.
I found a fix here:
|
@rothja, please can you set the following Git config and when you get a repro of the repeated auth prompt, complete auth and then send over the resulting log file. # Windows
git config --global credential.trace C:\Users\USERNAME\gcm.log
# Mac/Linux
git config --global credential.trace /tmp/gcm.log You may want to glance over the file for any private information before sharing, for good measure. To turn off the logging after, you can run the following: git config --global --unset credential.trace |
Another day, another problem. Or rather back to the first problem. I, too, am getting the duplicate account dialog again. I am attaching my credential trace. |
I just want to make sure that WSL should still have this setting:
It is different than what is set in my Windows prompt, which is:
|
Hi, I am using VScode Remote Containers and had the same issue. I think there might be others who use a similar environment to mine, so I would like to summarize here what I have done to deal with the situation. EnvironmentWSL2+Docker+VScode Versions[Host] [Container] My operation
This is my first time writing such a long comment in English, so I apologize if it is unclear or incorrect. |
I followed the advice of @UTshion and I signed out of GitHub from VSCode, removed all of the Git and GitHub entries from Windows Credential manager and signed in again. I have not had problems since, but I need to work through a whole business day or two before I can declare victory. |
OMG, literally seconds after posting the above, I got the duplicate account dialog again! It is showing with every git interaction again!!! |
I am beginning to think that I have several extensions that all sign into GitHub and one of them is generating a different credential type and that is what causes the Duplicate Account dialog box. Now to figure out which one is doing it... |
@RobCannon - the following should force GCM to use the correct username for all GitHub repos:
Hopefully that will resolve the issue for you. |
We've updated our docs on this issue for future reference: https://gh.io/gcm/multipleusers#tldr-tell-gcm-to-remember-which-account-to-use @rothja this may also help solve your situation also. |
YES. THANK YOU @ldennington - After many hours spent with GitHub Support and our company's IT team troubleshooting this issue, which started 7/13 for me, that line looks like it worked:
No more prompt on every remote action. I won't say so for sure just yet, as I thought the problem was solved a couple of times before and it came back. |
Feels like I should close this issue now, right? |
Yes, I believe we are good to close this - I will go ahead and do so. |
As documented by git-credential-manager here: https://github.com/git-ecosystem/git-credential-manager/blob/main/docs/multiple-users.md#tldr-tell-gcm-to-remember-which-account-to-use Otherwise it may prompt you to select an account (javierjulio or x-access-token) on any git action. git-ecosystem/git-credential-manager#1325
git credential-manager github list returned no output for me. My fix was simply to open the windows credential manager and modify the user name on each "Personal Access Token" account to "Personal Access Token 1" , "Personal Access Token 2", etc to identify the correct account. I then removed the duplicitous accounts in Windows credential manager and the issue went away. |
Thanks. I've updated git bash first and then followed these instructions and finally it worked for me as well. By the way I have both vs and vs code, so I've logged out from github in both apps just in case, even though I've been getting this duplicated account choice only from vs. |
Feature description
I have multiple Git accounts.
When the popup Select Account shows up... I have the choice between "Personal Access token" and "Personal Access token".
There is no way to make any distinctions.
See screenshot
The text was updated successfully, but these errors were encountered: