【问题标题】:Deleting the credentials from Windows Credential Manager still displayed credentials when using git credential fill command使用 git credential fill 命令时,从 Windows 凭据管理器中删除凭据仍然显示凭据
【发布时间】:2021-03-24 22:55:42
【问题描述】:

我正在运行最新的 Git For Windows 2.29.2 ,对我来说 credential.helper 默认设置为 manager-core。我确实确认运行git config --system --list

我想为任何 git 操作 w.r.t GitHub 实现基于令牌的身份验证。所以我继续从Control-Panel-> Credential manger -> Windows Credential -> Generic Credentials 中删除了凭据(最初是用户名/密码组合)。 然后我执行了命令:

git credential fill
protocol=https
host=github.com`
<HIT ENTER KEY TWICE, as A blank line signals input completion>

令我惊讶的是,上面的命令仍然返回凭据。我回到控制面板并确认它是否已被删除并且我看不到凭据,即它们已被删除。

为什么上面的命令成功地返回了凭据。据我所知,git 也会在内存中缓存 15 分钟的凭据。然而,上面的命令在几个小时后仍然返回了凭据。我尝试打开新的提示,但直到今天才走运,大约一天后我碰巧注意到该行为不再可重现。

现在它按预期工作,即如果我从控制面板的凭据管理器中删除凭据,则 git credential fill 无法返回任何凭据,而是提示我输入凭据。

为什么git credential fill 首先返回凭据,即使我在几个小时后尝试过?我只是无法理解这种行为。

【问题讨论】:

    标签: git git-credential-manager


    【解决方案1】:

    git config --system list 仅显示系统级配置,请尝试使用git config list --show-origin

    您可以在不同的配置级别配置多个凭据助手,如果前一个不返回凭据,git 将依次使用它们,听起来您可能在其他地方配置了另一个

    【讨论】:

    • 这确实有道理。但是,运行 git config --list --show-origin 只会返回一次出现的 credential.helper,并且值为 manager-core。我没有尝试过这个命令,但我确实尝试过运行 git config --listgit config --global --list 并且从未多次出现 credential.helper
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-02-07
    • 1970-01-01
    • 2020-02-15
    • 2011-11-02
    相关资源
    最近更新 更多