I'm assuming that the operating system is Windows.
Where git looks for the file
The .gitconfig
file with the --global
option is in the system user directory. View 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. Correct this path and give the necessary permission for the Git process.
Alternative
The question mentions the command ls
, which is not from Windows.
If you are using a tool such as MSys , you can put the Git configuration file in another location, such as < a href="http://git-scm.com/book/en/Getting-Started-First-Time-Git-Setup"> described in the documentation .
Just use the option --system
instead of --global
. The file will be stored in the /etc/gitconfig
directory.
In the latter case, the configuration must be done by repository.