I am assuming that the operating system is Windows.
Where git looks for the file
The archive .gitconfig
with the option --global
is in the system user directory. See the configuration documentation.
While in linux the path can be represented by ~/.gitconfig
, in Windows we have:
Or, using the system variable, simply: %USERPROFILE%\.gitconfig
Solution
Check the value of the system variable. Fix this path and give the necessary permission for the Git process.
Alternative
The question quotes the command ls
, that is not Windows.
If you’re using a tool like Msys, it is possible to place the Git configuration file in another location, such as described in the documentation.
Just use the option --system
instead of --global
. The file will be stored in the directory /etc/gitconfig
.
In the latter case, the configuration will have to be done by repository.
If you are in a corporate network, the folder
home
user may be configured in a unit mapped on the network. (I Hate corporate Networks)– utluiz