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

如何修复git config报错:git: 'credential-credential-store'不是git命令

解决Git推送时的git: 'credential-credential-store' is not a git command错误

你遇到的问题本质是Git的凭证助手配置写错了——大概率是把credential.helper的值误写成了credential-store,而正确的写法应该是store(多了个多余的credential-前缀)。你之前移除整个credential配置段没解决问题,可能是因为错误配置还藏在全局或本地的某个配置文件里,或者后续操作又自动生成了错误设置。

试试下面这些步骤来修复:

  • 第一步:定位错误配置的位置
    先全局和本地都排查一遍,找到所有包含credential的配置项及其所在文件:

    git config --list --show-origin | grep credential
    

    这个命令会输出类似这样的结果,帮你定位到错误配置的来源(比如全局的~/.gitconfig或者项目本地的.git/config)。

  • 第二步:修正凭证助手配置
    如果发现某个配置里的credential.helper是credential-store,直接改成正确的store:

    • 修正全局配置:
      git config --global credential.helper store
      
    • 修正项目本地配置(如果错误在项目层面):
      git config credential.helper store
      

    要是你不需要自动存储凭证,也可以直接清空这个配置:

    git config --global credential.helper ""
    
  • 第三步:手动编辑配置文件(命令行修正无效时)
    打开刚才查到的配置文件:

    • Linux/macOS全局配置:~/.gitconfig
    • Windows全局配置:C:\Users\<你的用户名>\.gitconfig
    • 项目本地配置:项目根目录下的.git/config
      找到类似下面的段落:
    [credential]
        helper = credential-store
    

    把helper的值改成store,或者直接删掉整个[credential]段(如果你不需要凭证自动存储功能)。

  • 第四步:验证修复效果
    重新执行Git推送命令,看看错误是否消失。如果还有问题,再重复第一步检查配置,确保没有遗漏的错误项。

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

相关产品推荐
方舟 Agent Plan

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

最近更新时间:2026.05.28 10:06:21