How to remove GitHub password from VSCode?

冷暖自知 提交于 2020-05-11 14:48:30

问题


I have cloned one of my GitHub repositories with VSCode and I have made some commits. VSCode has asked me for my GitHub password when I have done the first commit.

I have rebooted the computer and now I can make commits as before, but VSCode 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 VSCode forget my GitHub password?

I have tried the git command:

git config --global --unset-all user.email

But VSCode still lets me commit without asking.


回答1:


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.

    git credential-manager reject https://github.com
    
  • if it is a osxkeychain, see "Updating credentials from the OSX Keychain"

    git credential-osxkeychain erase https://github.com
    

Reminder, those credentials (username/password) have nothing to do with your git config user.name/user.email.




回答2:


I'm a long time user of VS Code on both Windows and Mac. After looking into Windows Credential Manager and removing the problematic user on Windows 10, if I push from VS Code the problematic user would return. This is of course after restarting VS Code, the system, etc, and trying multiple times. The entry would re-appear in Windows Credential Manager each time.

At some point I decided to try to edit the entry instead of deleting it. This approach worked. Give that approach a try if removing the entry doesn't seem to solve the issue.



来源:https://stackoverflow.com/questions/48413031/how-to-remove-github-password-from-vscode

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!