17

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.

Alice
  • 195
  • 1
  • 6

1 Answers1

15

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.

Mark Longair
  • 446,582
  • 72
  • 411
  • 327
  • 4
    That's right. The `git config` man page, however, will note the defaults for most options. – mipadi May 13 '11 at 15:37
  • See an extended discussion of the problem getting default values in [this answer to a similar question](http://stackoverflow.com/a/33720449/2392683). – chwarr Jan 19 '16 at 20:42