【问题标题】:Change Git Account in VSCode在 VSCode 中更改 Git 帐户
【发布时间】:2017-06-17 12:07:00
【问题描述】:

在同步我的更改时,VSCode 第一次尝试连接时,我不小心输入了旧 github 帐户的凭据(旧帐户的凭据是正确的,但我想使用新帐户)。

现在我找不到更改帐户的方法。已经尝试卸载/安装,但 VSCode 不断记住我的登录信息。

任何想法如何刷新给定的帐户?

【问题讨论】:

    标签: git visual-studio-code vscode-settings


    【解决方案1】:
    git config --global --unset credential.helper
    

    这将为您的系统取消设置 git 凭据,现在您可以使用新凭据,然后为 git 启用缓存

    git config --global credential.helper wincred
    git config --system credential.helper wincred
    

    这将再次启用缓存以保存 git 密码

    【讨论】:

    • 感谢您的回答!这似乎对我不起作用:/ 如果我这样做git credential-manager 我得到usage: git credential-manager [approve|clear|delete|deploy|erase|fill|get|install|reject|remove|store|uninstall|version] [<args>] fatal: Unable to open help documentation
    • 在 git bash 上试试这个并使用上面提到的完整命令。我在我的系统上尝试了这个,并且工作起来就像一个魅力。
    • 在 Windows 10 上对我有用的是转到 Control Panel > Use Account > Credential Manager > Windows Credentials 然后删除 github.com 的现有凭据,然后当您尝试在 VSCode 中执行 git push 时,它应该提示输入 github login ,然后使用正确的登录名。因此,更改 github 连接实际上位于 VSCode 之外。
    猜你喜欢
    • 2020-09-25
    • 1970-01-01
    • 2018-03-19
    • 1970-01-01
    • 2023-03-02
    • 2020-03-11
    • 2017-07-06
    • 2016-12-20
    • 2021-10-05
    相关资源
    最近更新 更多