When using git config --global
to set things up, to which file will it write?
Example:
git config --global core.editor "blah"
I can't find it at these places:
C:\Program Files\Git\etc\gitconfig
C:\myapp\.git\config
I have not set an ENV?
My Git version: 1.6.5.1.1367.gcd48 – on Windows 7
On *nixes, it's in
~/.gitconfig
. Is there a corresponding file in your home?On Windows you can type in git bash
The global location is derived, on Windows MsysGit, using the HOMEDRIVE and HOMEPATH environment variables, unless you have defined a HOME environment variable. The is detailed in the 'profile' script.
In my corporate environment the HOMEDRIVE is H:, which is then mapped to a network URL \\share\$. The whole lot is then mapped to be "My Documents", which isn't where others would expect. There may have been some further problems with the drive to URL remapping. I don't even get to adjust the HOMEDRIVE or HOMEPATH variables anyway.
In my case I have defined a personal HOME environment variable and pointed it to D:\git\GitHOME and copied all those GIT files (which are without and extension) to the GitHOME directory for safe keeping.
The windows environment variables can be set via the Advanced tab in the My Computer properties dialog.
If you are using TortoiseGit on a windows PC you can use:
to open the global .gitignore file.
But if you use your Windows (7) PC in a domain your profile dir is may be a network share (mounted as a drive). In this case TortoiseGit (at least:1.6.5.0) is pointing you to the wrong dir (on c:...). See the closed TortoiseGit issue 922 for more information. Or using %HOMEDRIVE%%HOMEPATH% to open the dir that contains the .gitignore file.
It might be useful to note (for *nix platforms): some types of global git configuration/information are stored in
/usr/share/git-core/
, such as git autocompletion scripts and the following (default) hooks:Each of these can contain their own set of commands to execute, at the time described by their respective filenames.
I had also a problem with my global
.gitconfig
This is for the case someone also has this strangegit said:
Now I fixed it. The problem was a second
.gitconfig
in this folder:I don't know where it came from... But now everything works like a charme again.
The paths for msysgit are:
Windows XP -
C:\Documents and Settings\<user_name>\.gitconfig
Windows Vista+
C:\Users\<user_name>\.gitconfig