Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

git config: list all variables and their default values

Tags:

git

git-config

Similar to the MySQL show variables command that shows all variables and not just the ones defined in my.ini, I would like to see a list of all config variables in git along with their default values, and not just those defined in my ~/.gitconfig.

Is this possible?

like image 676
Harry Avatar asked Nov 15 '15 13:11

Harry


People also ask

What is ~/ Gitconfig?

git config is a powerful command in Git. You can use the Git configuration file to customize how Git works. This file exists in the project level where Git is initialized ( /project/. git/config ) or at the root level ( ~/. gitconfig ).


1 Answers

Edit Jan 23, 2022

  • git config --system -l for system-wide variables (retrieved from installation folder; references)

  • git config --global -l for global variables (retrieved from ~/.gitconfig or $XDG_CONFIG_HOME/git/config if the first doesn't exists; references)

  • git config --local -l or git config -l for repository variables (retrieved from .git/config; references)

Also note that although on docs it says

--local [...] This is the default behavior.

issuing git config -l --local shows a different result than git config -l, the latter (apparently) showing all the three command outputs merged (tested on Windows)


Old answer

git config --global -l for global variables or git config -l for local repository variables

P.S.: I know have passed 2 years since you posted the question, but I was looking for the same thing and I read this post so I guessed users like me would have wanted a solution to their problem and I posted a reply, even if you probabily have solved your problem long time ago.

like image 62
Matteo Meil Avatar answered Sep 20 '22 15:09

Matteo Meil