Change GIT account of Visual Studio Team Explorer

96,275

Solution 1

Look in the Windows Credential manager and remove/update your credentials there:

enter image description here

Solution 2

In my case just removing credentials from Windows Credential didn't fix it. I first removed all git and azure related accounts from Windows Credential, then removed accounts from VS>Files>Account Settings, and then VS asked me new credentials and connected to the project. But my commits were still made with the old account! Finally I found out that it was the git config:

C:\Users\[USER NAME]\.gitconfig

I deleted the whole user section in that file which looks like this:

[user]
    name = [OLD ACCOUNT NAME]
    email = [OLD ACCOUNT EMAIL]

On next commit VS asked me git account information and done.

If you want to work with different accounts for different projects on same machine, read this.

Solution 3

I am using VS 2017 and this is how I updated my Password for TFS, using Git repository.

  1. From the Menu: Team -> manage Connection
  2. Click on Manage Connection Link -> Connect to Project

enter image description here

It will then open window to connect to your project, here you can update your password.

Share:
96,275

Related videos on Youtube

Luke Vo
Author by

Luke Vo

Updated on July 22, 2020

Comments

  • Luke Vo
    Luke Vo almost 4 years

    I am having a very weird situation when cloning a Git repository from our company private server. The repository is not anonymous (it requires authentication), but when cloning, VS didn't ask any username and password and automatically use an old authentication of old employee. Is there a way to remove the saved username and password and make Visual Studio to prompt them when cloning?

  • Luke Vo
    Luke Vo almost 9 years
    Thank you I have never entered this place of my computer. TIL!
  • Alexander Schmidt
    Alexander Schmidt over 6 years
    Under Windows 10 use rundll32.exe keymgr.dll,KRShowKeyMgr to open this regardless of the language in the OS.
  • Max Alexander Hanna
    Max Alexander Hanna over 4 years
    works for my gitlab account and the gitlab visual studio 2017 plugin. thanks
  • Kappacake
    Kappacake over 4 years
    I don't have any credentials in my credentials manager! Visual Studio does not prompt me for credentials and tells me it cannot access the repository
  • Kappacake
    Kappacake over 4 years
    As mentioned in my comment above, I didn't have any credentials to delete on my credentials manager. What did the trick in my case was deleting the .gitconfig file, altogether (check @saastn answer)
  • DaFi4
    DaFi4 over 3 years
    once the other answer worked, but this time, this was the only thing that worked. Thanks saastn
  • sandy
    sandy almost 3 years
    @AlexanderSchmidt thank you so much! since i don't have administrative permissions on my system i could finally open the credential manager via your "code"