无法从 git 更改用户名和密码

Can't change username and password from git

我使用 git 扩展名。 我希望将密码和用户名存储在缓存中,所以我使用了: git-凭据-winstore。 它工作正常,直到我不得不更改我的计算机 (win7) 中的密码并且它再次要求我输入密码。我输入了错误的密码,它存储在缓存中,我无法更改。 我尝试卸载 git 但没有用。 我从 .gitconfig 文件中删除了 user\myUser 行:

[credential]
helper = !'C:\Users\grin_d\AppData\Roaming\GitCredStore\git-credential-winstore.exe'

结果每次密码和用户名都要重新插入。当我再次 运行 时:git-credential-winstore 它再次向我显示错误的密码。

知道如何删除缓存中存储的错误密码吗?

勾选control panel / User Accounts and Family Safety / User Accounts,或者直接Credential Manager:

(图片来自“Credential Manager - Where Windows Stores Passwords & Login Details”)

您应该可以在那里删除错误的凭据。

2021 年更新:

在 Microsoft 的“Git-Credential-Manager-Core”之后,更新的凭证助手现在是“manager-core”:一个 Git Credential Manager Core (GCM Core),一个安全的 Git 基于 .NET 构建的凭证助手,可在 Windows 和 macOS 上运行(Linux 支持处于早期预览阶段)。

删除密码:

printf "protocol=https\nhostname=github.com" | git credential-manager-core erase

我使用 http://[yourgitserverip]/Bonobo.Git.Server/Repository/[repositoryname] 更改密码。那么;

  1. 删除 Windows 凭据上的 git 凭据。
  2. 在(c:/Users/[YourAccount] 文件夹)中找到 .gitconfig 文件
  3. 添加这一行(如果不存在):

    [凭据] 帮手 = !\"C:/Program Files (x86)/GitExtensions/GitCredentialWinStore/git-credential-winstore.exe\"