Configure user.name

7

When I write the command git config --global user.name the error occurs:

  

Could not lock config file z: //.gitconfig No such file or directory.

The installation was done by default in C: but when I set the directory ( ls ) it lists the Z: disk in my network.

    
asked by anonymous 15.04.2014 / 14:27

1 answer

0

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:

  • XP : C:\Documents and Settings\<usuario>\.gitconfig

  • After the Vista : C:\Users\<usuario>\.gitconfig

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.

    
15.04.2014 / 16:37