"credential-manager" 不是一个 git 命令。

32

我使用的是Windows 10 64位操作系统,git版本是2.33.1.windows.1,与Azure repos配合使用。自从上次更新后,当我使用最新版本的TortoiseGit v2.13.0.1克隆存储库时,会出现以下错误。

git.exe clone --progress -v "https://FenergoProduct@dev.azure.com/FenergoProduct/FlareDocumentation/_git/FlareFenergoRegulationMargin" "C:\Flare\FlareFenergoRegulationMargin"
Cloning into 'C:\Flare\FlareFenergoRegulationMargin'...
git: 'credential-manager' is not a git command. See 'git --help'.

The most similar command is
credential-manager-core

有人能简单地解释一下如何摆脱这个问题吗?

P.


10
尝试运行命令:git config --global credential.helper manager-core - ElpieKay
谢谢 - 不幸的是,这似乎不起作用(请注意,该命令没有输出):$ git config --global credential.helper manager-core$ git pull git: 'credential-manager' is not a git command. See 'git --help'.最相似的命令是 credential-manager-core 已经是最新的。 - oceanclub
1
似乎您的Windows凭据管理器出了些问题。尝试使用git config --global credential.helper store命令,它会将用户名和密码/令牌默认存储在~/.git-credentials文件中。如果您不想使用凭据助手,也可以运行git config --global --unset credential.helper命令来禁用它。 - ElpieKay
当我运行“git config --global credential.helper store”时,我没有得到任何输出,我应该看到什么? - oceanclub
我进一步尝试了以下操作:1)完全删除Git,包括C:\Users<username>中的相关文件,如.gitconfig。2)从Windows凭据管理器中删除任何git凭据。3)重新安装git。4)运行"git credential-manager-core unconfigure"。5)运行(如上所建议)git config --global credential.helper store。6)运行(如上所建议)git config --global --unset credential.helper。在所有情况下,当我运行“git pull”时,仍然会出现主题线中的错误。 - oceanclub
显示剩余3条评论
7个回答

39

在我最近的升级之后,每个服务都出现了相同的错误消息。通过为凭据管理器创建别名,我使它们消失了。

git config --global alias.credential-manager "credential-manager-core"

除了错误信息之外,凭据管理器在创建别名之前和之后似乎都正常工作。


3
谢谢你!我已经尝试过修复那个问题了。 - Eugene D
我尝试过了,在远程的Linux机器上对我没起作用。 - undefined

12

git config --global -e 移除这行: credential.helper=manager-core


太棒了!我在这里修复了它...我在搞git的时候搞砸了,陷入了这种情况。 :D - undefined

8

我也遇到了这个错误。然而,我尝试了更多的方法,最终下面的命令对我起作用了。当我们替换所有配置细节时,它会修复。运行下面的命令后,您可以再次尝试git命令,如clone、pull、push等。然后自动提示登录屏幕。成功登录后,您就可以毫无问题地工作了。

git config --global credential.helper manager-core --replace-all

这对我有效。我在所有操作(获取、提交等)上都有永久性错误“git-credential-manager-core.exe: 没有这个文件或目录”。在运行此命令后,获取操作可以正常进行。 - Alexandra Sh
5
之后我这样做之后,烦人的消息就打印了两次 :) - Evgeniy Chekushkin
我不认为这对我有用,因为我正在使用一个远程(无头)机器,无法打开登录界面。 - undefined

7
所以,没有一个答案能够帮助我。我做了什么?我手动从全局和系统配置中删除了所有的 [credintial] 和 [alias] 部分。 对于 MINGW64 的系统配置,在这里: C:\Program Files\Git\mingw64\etc\gitconfig 我删除了这个部分:
[credential]
    helper = manager-core

从MINGW64的全局配置中,这里是路径: C:\Users\.gitconfig 我删除了这些部分:

[alias]
    credential-manager = credential-manager-core
[credential]
    helper = manager-core

现在我不再收到这个烦人的消息了


1
这是对我有效的方法。我的仓库服务器是gitlap。我在我的.gitconfig文件中有以下几行: [credential "https://server_address.ipip.com"] provider = generic - piedramania
对我来说也是一样。在[credentials]部分中,我有几个条目,其中有一行不完整,还有一个重复的。手动清除它们解决了问题。 - undefined

1
您应该检查您正在使用的 Git 版本:我遇到了相同的问题,并发现我正在使用 MSys2 的 Git 软件包而不是 GitForWindows,而 crediential-manager 只适用于 Microsoft 的 Git 端口。
在您的 shell 中使用 where git 命令来查看实际使用的 git.exe 路径。
❯ where git
C:\msys64\usr\bin\git.exe
C:\Program Files\Git\cmd\git.exe

如果第一行指向msys64而不是Program Files(如上所示),请卸载Git的MSys2软件包。
❯ pacman -R git
checking dependencies...

Packages (1) git-2.41.0-1

Total Removed Size:  35.97 MiB

:: Do you want to remove these packages? [Y/n] Y
:: Processing package changes...
(1/1) removing git

这个对我来说修复了凭证管理器。
❯ where git
C:\Program Files\Git\cmd\git.exe

❯ git credential-manager
Required command was not provided.

git-credential-manager

Usage:
  git-credential-manager [options] [command]

Options:
  --version       Show version information
  -?, -h, --help  Show help and usage information

Commands:
  get          [Git] Return a stored credential
  store        [Git] Store a credential
  erase        [Git] Erase a stored credential
  configure    Configure Git Credential Manager as the Git credential helper
  unconfigure  Unconfigure Git Credential Manager as the Git credential helper
  diagnose     Run diagnostics and gather logs to diagnose problems with Git Credential Manager
  azure-repos  Commands for interacting with the Azure Repos host provider

请注意,自2021年8月13日起,您将无法在GitHub上使用此凭证管理器。
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.

0
这个命令 "git config --global credential.helper manager-core" 对我很有效。在我的公司电脑上,每次我更改密码时都会出现错误。以前我可以通过凭据管理器来修复这些错误,但现在不行了。

-1
我尝试了各种方法,但直到我改用手机热点连接我的笔记本电脑,而不是使用Wi-Fi,它才开始工作。

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接