You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Ubuntu 18.04.3 LTS服务器配置Git凭证存储后出现'credential-manager'命令不存在错误的问题求助

解决Ubuntu 18.04上Git凭证存储的问题

看起来你的Git配置里存在冲突的凭证助手设置——错误提示找不到credential-manager,这说明某个配置层级(本地仓库或系统级)里还残留了这个Windows平台常用的凭证助手配置,覆盖了你设置的store助手。咱们一步步来解决:

1. 定位冲突的配置来源

首先运行这个命令查看所有层级的凭证助手配置,它会显示每个配置对应的文件路径:

git config --show-origin --get credential.helper

你可能会看到类似这样的输出:

file:/home/user/.gitconfig    store
file:.git/config              credential-manager

或者系统级配置文件里有credential-manager的记录。

2. 清除冲突的配置

  • 如果是本地仓库的配置(对应.git/config文件),进入你的项目目录,运行:
    git config --unset credential.helper
    
  • 如果是系统级的配置(通常在/etc/gitconfig),需要用sudo权限清除:
    sudo git config --system --unset credential.helper
    

3. 重新设置全局凭证存储助手

再次运行全局配置命令确保生效:

git config --global credential.helper store

你可以用这个命令验证配置:

git config --global credential.helper

正常应该输出store。

4. 验证效果

现在执行git pull,这时候你需要输入一次用户名和密码——输入完成后,Git会把凭证保存到~/.git-credentials文件里,之后再执行Git操作就不会再要求输入账号密码了。

补充说明

credential-manager是Windows平台Git的默认凭证助手,Ubuntu上并没有这个工具,所以如果之前不小心设置了(比如从Windows迁移配置),就会出现这个错误。通过清除所有层级的冲突配置,再设置Ubuntu支持的store助手,就能解决问题啦。

内容的提问来源于stack exchange,提问作者goedwig

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.04.29 20:52:37