【问题标题】:error: could not lock config file C:/Program Files/Git/mingw64/etc/gitconfig: Permission denied错误:无法锁定配置文件 C:/Program Files/Git/mingw64/etc/gitconfig: Permission denied
【发布时间】:2019-02-07 23:37:21
【问题描述】:

我想运行这个 Git 命令:

git submodule add https://github.com/example/example.git

但我收到此错误:

正在克隆到 'C:/projects/xxx/yyy/zzz/'... 致命:无法访问“https://github.com/xxx/yyy.git/”:设置证书验证位置时出错:
CAfile: C:\Program Files (x86)\git\bin\curl-ca-bundle.crt
CApath:无
致命:将“https://github.com/xxx/yyy.git”克隆到子模块路径“C:/projects/xxx/yyy/zzz/example”失败

所以,为了解决这个问题,我正在尝试运行以下命令:

git config --system http.sslcainfo "C:\Program Files (x86)\git\bin\curl-ca-bundle.crt"

但我收到此错误消息:

错误:无法锁定配置文件 C:/Program Files/Git/mingw64/etc/gitconfig: Permission denied

我该如何解决这个问题?

【问题讨论】:

  • 您必须以管理员身份运行该命令,或者直接跳过--system 切换。
  • 我有一个类似的问题(克隆尝试给出:错误设置证书验证位置:CAfile:C:/Program Files/Git/mingw64/libexec/ssl/certs/ca-bundle.crt CApath : 无

标签: git


【解决方案1】:

您需要处于管理员模式才能执行命令(在 cmd 终端或 windows10 上的 PowerShell(管理员)中)

【讨论】:

    【解决方案2】:

    我遇到了类似的问题,Git Bash 报告了 git pull 命令的致命“错误设置证书验证位置”。实际的问题是身份验证,因为我最近更改了我的 Windows 密码。解决方案是删除凭据管理器中的 git 凭据(Windows 7 | 控制面板 | 所有控制面板项 | 凭据管理器),然后尝试两次 git pull 以强制 Git Bash 提供提示输入新密码的 Windows 弹出窗口。不再有证书错误。

    在过去更改 Windows 密码后,我们只需要退出 BitBucket 即可让 Git Bash 启动 Windows 弹出窗口以输入新密码。这次没有出现弹出窗口,并且我开始收到证书错误,因此删除凭据是解决方案。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-11-22
      • 1970-01-01
      • 2017-10-18
      • 2022-08-18
      • 2018-04-18
      • 2016-08-22
      • 2019-01-25
      • 1970-01-01
      相关资源
      最近更新 更多