git:'credential-manager' 不是 git 命令

goe*_*wig 22 git

我有一台运行 Ubuntu 18.04.3 LTS 的服务器。我想保存我的 git 凭据,这样我就不必每次都输入它们。我运行以下命令:

git config --global credential.helper store
Run Code Online (Sandbox Code Playgroud)

然后我git pull得到:

user@host:~/project$ git pull
git: 'credential-manager' is not a git command. See 'git --help'.
usage: git credential-store [<options>] <action>

    --file <path>         fetch and store credentials in <path>

Username for 'https://gitlab.com':
Run Code Online (Sandbox Code Playgroud)

之后,系统会要求我提供用户名和密码。然后打印出同样的错误。

我已经多次重复相同的过程,credential.helper通过以下方式取消设置该选项:

git config --global --unset credential.helper
Run Code Online (Sandbox Code Playgroud)

小智 35

我执行了这个命令

git config --global --unset credential.helper
Run Code Online (Sandbox Code Playgroud)

此时我在 git pull 命令之后已经没有错误了。我有版本 2.34.1.windows.1 的 git


Use*_*ess 7

文档显示了命令

$ git config --global credential.helper 'store --file ~/.my-credentials'
Run Code Online (Sandbox Code Playgroud)

所以看起来很可能git只是执行 中设置的命令credential.helper设置的命令只是store...需要一个强制参数...您尚未提供。

这解释了为什么该store命令(实际上git credential-store)没有按您的预期工作。

我不知道这个抱怨从何credential-manager而来——很可能只是将所有失败状态错误地报告为“不是 git 命令”。