I was trying to make some updates to my global .gitconfig file on my Windows 7 machine. I have Git installed via the https://git-scm.com/ for Windows. The file was located at C:\Users\MyName\.gitconfig
, but when I ran some commands, the file wasn't updated.
I unistalled Git (and removed the user .gitconfig) and reinstalled Git. The install didn't create a C:\Users\MyName\.gitconfig
file. However, if I rungit config --global user.name "My Name"
and do a git config --list
, I see user.name=My Name
in the list of attributes.
I still don't have a .gitconfig file in my user directory nor is there one in C:\Users\MyName\.config\git\
directory.
Is there a command to find out where the global config file is?
gitconfig located in the user's home folder (C:\Users\git user) Local Git configuration: File named config in the . git folder of the local repo.
The reason they can't find gitconfig is simply because it's nowhere to be found. When developers install Git, the various Git configuration files won't automatically create. Files like gitconfig and . gitconfig are only created when they're first used.
Your global git configuration is written to ~/. gitconfig . To override git configuration on a per-project basis, write to path/to/project/. git/config .
How do I find Gitconfig on Mac? The global Git configuration file is stored at $HOME/. gitconfig on all platforms. However, you can simply open a terminal and execute git config , which will write the appropriate changes to this file.
type:
git config --list --show-origin
then you will see the location of file .gitconfig
. (The command works on Windows, Mac OS X, Linux)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With