Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I get the real config value in Git?

Tags:

git

It seems that git config only returns value that I explicitly set and doesn't aware of the default values. For example when I run git config commit.status it outputs nothing.

http://git-scm.com/docs/git-config helps but doesn't list all of the default values.

like image 235
Alice Avatar asked May 13 '11 11:05

Alice


People also ask

Which command gives details of git configuration?

The git config command is a convenience function that is used to set Git configuration values on a global or local project level. These configuration levels correspond to . gitconfig text files. Executing git config will modify a configuration text file.


1 Answers

Unfortunately, I don't think this is possible. Perhaps someone more familiar with the git source code will correct me, but I think that the default values are typically hard-coded in the source files and overridden by the config variables. For example, the default for gc.pruneExpire is defined here and potentially overridden here when the configuration is checked. I don't think there's any mechanism for git config to get at that default value.

like image 130
Mark Longair Avatar answered Oct 11 '22 14:10

Mark Longair