如何从 Visual Studio Code 中删除 GitHub 密码? [英] How can I remove a GitHub password from Visual Studio Code?

查看:60
本文介绍了如何从 Visual Studio Code 中删除 GitHub 密码?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经使用 Visual Studio Code 克隆了我的一个 GitHub 存储库,并进行了一些提交.当我第一次提交时,Visual Studio Code 要求我提供我的 GitHub 密码.

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.

我已经重新启动了计算机,现在我可以像以前一样进行提交,但是 Visual Studio Code 不会要求我输入密码.似乎密码已被存储.但这台电脑不是我的电脑,我不希望其他人可以使用我的帐户.

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.

如何让 Visual Studio Code 忘记我的 GitHub 密码?

How can I make Visual Studio Code forget my GitHub password?

我已经试过了 Git 命令:

I have tried the Git command:

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

但 Visual Studio Code 仍然让我无需询问即可提交.

But Visual Studio Code still lets me commit without asking.

推荐答案

检查你的 git config credential.helper:

  • 如果是 manager,则需要打开 Windows 凭据管理器并在那里删除凭据.
    有关说明,请参阅此答案.
    或者,在命令行中:

  • 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
host=github.com" | git credential-manager-core erase

  • 如果是 osxkeychain,请参阅从 OSX 钥匙串更新凭据"

    printf "protocol=https
    host=github.com" | git credential-osxkeychain erase
    

  • 提醒,这些凭据(用户名/密码)与您的 git 配置 user.name/user.email 无关.

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

    这篇关于如何从 Visual Studio Code 中删除 GitHub 密码?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆