错误:无法锁定配置文件C:/Program Files/Git/mingw64/etc/gitconfig:权限被拒绝 [英] error: could not lock config file C:/Program Files/Git/mingw64/etc/gitconfig: Permission denied
问题描述
我想运行以下Git命令:
I would like to run this Git command:
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"失败
Cloning into 'C:/projects/xxx/yyy/zzz/'... fatal: unable to access 'https://github.com/xxx/yyy.git/': error setting certificate verify locations:
CAfile: C:\Program Files (x86)\git\bin\curl-ca-bundle.crt
CApath: none
fatal: clone of 'https://github.com/xxx/yyy.git' into submodule path 'C:/projects/xxx/yyy/zzz/example' failed
因此,要解决此问题,我正在尝试运行以下命令:
So, to fix this, I am trying to run this command:
git config --system http.sslcainfo "C:\Program Files (x86)\git\bin\curl-ca-bundle.crt"
但是我收到此错误消息:
But I get this error message:
错误:无法锁定配置文件C:/Program Files/Git/mingw64/etc/gitconfig:权限被拒绝
error: could not lock config file C:/Program Files/Git/mingw64/etc/gitconfig: Permission denied
我该如何解决?
推荐答案
您需要处于管理员模式才能执行命令(在cmd终端或Windows10上的PowerShell(管理员)中)
you need to be in admin mode to execute the command (in cmd terminal or in PowerShell (Admin) on windows10)
这篇关于错误:无法锁定配置文件C:/Program Files/Git/mingw64/etc/gitconfig:权限被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!