views:

667

answers:

3

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

C:\myapp.git\config

I have not env set?

git version 1.6.5.1.1367.gcd48 on Windows7

+1  A: 

On *nixes, it's in ~/.gitconfig. Is there a corresponding file in your home?

Ben
This should be the same on windows.
Felix Kling
+2  A: 

for msysgit it's C:\Documents and Settings\<user>\.gitconfig

hash
+1 for giving the path in XP, but on Vista and 7 it's elsewhere.
SamGoody
+3  A: 

"Windows" and "C:\Program Files\Git" means MSysGit.

If you look at etc/profile (in C:\Program Files\Git):

HOME="$HOMEDRIVE$HOMEPATH"

Meaning:

C:\Users\MyLogin

(on Windows7)

Since:

--global

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

That means the file is in C:\Users\MyLogin\.gitconfig for msysgit in Windows7.

VonC
I was being really dumb, I didnt add the "--global" flag to the edit command! "git config --global --edit" showed the file with all my config changes, "git config --edit" was the file I kept opening and thinking, where is that editor/compare/etc config item I just set! Many thanks.
IanVaughan