Ian Vaughan Ian Vaughan - 8 months ago 62
Git Question

Where does git config --global get written to?

Using the git config --global command to set things up, where is the file?

eg :

git config --global core.editor "blah"

Its not at these places :-

C:\Program Files\Git\etc\gitconfig


I have not env set?

git version on Windows7


From the docs:


For writing options: write to global ~/.gitconfig file rather than the repository .git/config.

Since you're using Git for Windows, it may not be clear what location this corresponds to. But if you look at etc/profile (in C:\Program Files\Git), you'll see:




(on Windows 7)

That means the file is in C:\Users\MyLogin\.gitconfig for Git in Windows 7.

Note: with git 2.8 (March 2016), you can simply use:

git config --list --show-origin

You will see which config is set where.
See "Where do the settings in my Git configuration come from?"