Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

error: could not lock config file C:/Program Files/Git/mingw64/etc/gitconfig: Permission denied

Tags:

git

I would like to run this Git command:

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

But I get this error:

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:

error: could not lock config file C:/Program Files/Git/mingw64/etc/gitconfig: Permission denied

How can I fix this?

like image 473
Robs Avatar asked Sep 02 '18 20:09

Robs


People also ask

What is ~/ Gitconfig?

git config is a powerful command in Git. You can use the Git configuration file to customize how Git works. This file exists in the project level where Git is initialized ( /project/. git/config ) or at the root level ( ~/. gitconfig ).

Why is there no Gitconfig file?

The reason they can't find gitconfig is simply because it's nowhere to be found. When developers install Git, the various Git configuration files won't automatically create. Files like gitconfig and . gitconfig are only created when they're first used.

How do I change Gitconfig?

The global git config is simply a text file, so it can be edited with whatever text editor you choose. Open, edit global git config, save and close, and the changes will take effect the next time you issue a git command. It's that easy.

Where is the Gitconfig file in Windows 10?

gitconfig located in the user's home folder (C:\Users\git user)


1 Answers

you need to be in admin mode to execute the command (in cmd terminal or in PowerShell (Admin) on windows10)

like image 92
user11693167 Avatar answered Nov 14 '22 12:11

user11693167