Cannot find Global.gitconfig FIle

I tried to make some updates for my global .gitconfig file on my Windows 7 machine. I have Git installed through https://git-scm.com/ for Windows. The file was in C:\Users\MyName\.gitconfig, but when I ran some commands, the file was not updated.

I unistalled Git (and removed the user .gitconfig) and reinstalled Git. The installation did not create the file C:\Users\MyName\.gitconfig. However, if I run git config --global user.name "My Name"and do a git config --list, I see user.name=My Namein the list of attributes.

I still do not have a .gitconfig file in my users directory, and also not in the directory C:\Users\MyName\.config\git\.

Is there a command to find out where the global configuration file is?

+4
source share
2 answers

A type:

git config --list --show-origin

then you will see the location of the file .gitconfig. (The team works on Windows, Mac OS X, Linux)

+9
source

Try running the following command: which file opens in the editor.

git config --global -e
+2
source

Source: https://habr.com/ru/post/1655663/


All Articles