Cannot find gitconfig file

I just started learning Linux and Git. I am using Linux Mint. I have Git and emacs installed via apt-get.

Im using the following tutorial https://git-scm.com/book/en/v2/Getting-Started-First-Time-Git-Setup

It says that there are configuration files in three different places:

  • /etc/gitconfig file
  • ~/.gitconfig or ~/.config/git/config file
  • config in the Git directory (i.e. .git / config) of any repository you are currently using.

I just started with Git, so suppose option 3) is not applicable

I checked both 1) and 2) - I just can't find the files anywhere

I searched for this with no luck and did sudo find . -name sudo find . -name in the root directory

I don’t know what happens when I run this

 $ git config --global user.name "John Doe" $ git config --global user.email johndoe@example.com 

(I obviously used my last name)

it doesn't give me an error or anything else - so where does it write this configuration data then? Where are these files located?

+8
git linuxmint
source share
2 answers

As the OP confirms, any git config --global will create / update ~/.gitconfig .

But since this is the default hidden file, you will need ls -alrt to see it.
git config --global -l display its contents.

In general, git config --list –show-origin displays all configuration files.

+6
source share

I got my configuration file using git config --system --list

0
source share

All Articles