I have cloned one of my GitHub repositories with Visual Studio Code and I have made some commits. Visual Studio Code has asked me for my GitHub password when I have done on the first commit.
I have rebooted the computer and now I can make commits as before, but Visual Studio Code does not ask for my password. It seems that the password has been stored. But this computer is not my computer and I do not want that somebody else could use my account.
How can I make Visual Studio Code forget my GitHub password?
I have tried the Git command:
git config --global --unset-all user.email
But Visual Studio Code still lets me commit without asking.
Check your git config credential.helper
:
if it is manager
, you would need to open your Windows Credential Manager and remove your credentials there.
See this answer for illustration.
Or, in command-line:
printf "protocol=https\nhost=github.com" | git credential-manager-core erase
if it is a osxkeychain
, see "Updating credentials from the OSX Keychain"
printf "protocol=https\nhost=github.com" | git credential-osxkeychain erase
Reminder, those credentials (username/password) have nothing to do with your git config user.name
/user.email
.
First you need to check where the passwords are located. The credentials store or the Windows generic password.
Run this in the Visual Studio Code terminal:
git config credential.helper
Go to and delete the file C:\Users\(username)\.git-credentials
or you can simply remove the @github user rows from the text file.
Then go to Windows password: Control Panel → All Control Panel Items → Credential Manager. The passwords are referenced to the GitHub label in generic.
Then log in into your GitHub account with your default browser. After that, restart Visual Studio Code. Clone from GitHub and follow the authorization steps from Visual Studio Code.
For Ubuntu/GNOME Visual Studio Code users, the Credential Manager can be accessed by launching the "Passport and Keys" application. You can delete the Visual Studio Code/GitHub entry by clicking "Password", looking for the entry and delete.
Restart Visual Studio Code after, and it would ask you to sign into GitHub all over again.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With