Configure user.name

Asked

Viewed 275 times

7

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

could not lock config file z://. gitconfig No such a file or Directory.

The installation was done by default on C: but when I list the directory (ls) he lists the disk Z: that is in my network.

  • 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)

1 answer

0


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:

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

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

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.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.