By default on Windows Git places global .gitconfig in c:\documents and settings\user\
How can I change that position so .gitconfig is stored in c:\my_configuration_files\
?
Can it be done at all?
By default on Windows Git places global .gitconfig in c:\documents and settings\user\
How can I change that position so .gitconfig is stored in c:\my_configuration_files\
?
Can it be done at all?
If you set HOME
to c:\my_configuration_files\
, then git will locate .gitconfig there. Editing environment variables is described here. You need to set the HOME variable, then re-open any cmd.exe window. Use the "set" command to verify that HOME indeed points to the right value.
Changing HOME will, of course, also effect other applications. However, from reading git's source code, that appears to be the only way to change the location of these files without the need to adjust the command line. You should also consider Stefan's response: you can set the GIT_CONFIG variable. However, to give it the effect you desire, you need to pass the --global
flag to all git invocations (plus any local .git/config files are ignored).