Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can't Find Global .gitconfig FIle

Tags:

git

config

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?

like image 821
sdoca Avatar asked Sep 23 '16 22:09

sdoca


People also ask

Where is my .gitconfig file?

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.

Why is there no Gitconfig file?

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.

Where can I find .gitconfig file in Linux?

Your global git configuration is written to ~/. gitconfig . To override git configuration on a per-project basis, write to path/to/project/. git/config .

Where is my .gitconfig file Mac?

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.


1 Answers

type:

git config --list --show-origin

then you will see the location of file .gitconfig. (The command works on Windows, Mac OS X, Linux)

like image 154
Do Nhu Vy Avatar answered Oct 02 '22 10:10

Do Nhu Vy