Cannot find gitconfig file

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

But as it is an hidden file by default, you would need a ls -alrt to see it.
git config --global -l will list its content.

More generally, git config --list --show-origin shows all config files (and each line of the config data).
With Git 2.26 (Q1 2020), you can add a --show-scope option

git config --list --show-origin --show-scope

That will also print the scope ("local", "global", etc) of all displayed config values.


With Git 2.37 (Q3 2022), confirm that git config --show-scope does show worktree, in addition of local, global, system and command configs.

See commit db7961e (07 Jun 2022) by Glen Choo (chooglen).
(Merged by Junio C Hamano -- gitster -- in commit 21bb385, 13 Jun 2022)

config: document and test the 'worktree' scope

Signed-off-by: Glen Choo

Test that "git config --show-scope"(man) shows the worktree scope, and add it to the list of scopes in Documentation/git-config.txt.

"git config --help"(man) does not need to be updated because it already mentions worktree".

git config now includes in its man page:

(worktree, local, global, system, command).


To find your global .gitconfig file:

  1. Open your terminal or command prompt
  2. Go to your root directory by typing cd ~
  3. Once in your root folder type ls -alrt
  4. You will see a .gitconfig file
    • To open your .gitconfig file type open .gitconfig

To find a particular repository's .gitconfig file:

  1. Open your terminal or command prompt
  2. Go to your repository's root directory by typing cd path/to/repository-directory
  3. Once in your repository's root directory type ls -alrt
  4. You will see a .git directory. Type cd .git
  5. Once in your repository's git directory type ls -alrt
  6. You will see a config file
    • To open your repository's .gitconfig file type open config

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

Tags:

Git

Linux Mint