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?
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 ).
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)
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.
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