Windows-specific Git configuration settings; where are they set?

前端 未结 3 816
情深已故
情深已故 2020-12-09 02:01

I\'ve read the Git documentation and Where do the settings in my Git configuration come from? and yet I still can\'t make sense of some of my settings.

I\'m on Git

3条回答
  •  伪装坚强ぢ
    2020-12-09 02:51

    As this commit explains, they've added another config location only for Windows, which is applied even before the --system:

    The file /etc/gitconfig can be used to store a system-wide default configuration. On Windows, configuration can also be stored in C:\ProgramData\Git\config; This file will be used also by libgit2-based software.

    ...

    On Windows, as there is no central /etc/ directory, there is yet another config file, intended to contain settings for all Git-related software running on the machine. Consequently, this config file takes an even lower precedence than the $(prefix)/etc/gitconfig file.

    So I believe you can find those mystery settings in C:\ProgramData\Git\config.


    From that commit I can see that git config --system --list should've shown you those settings, but it seems that the absence of C:\Program Files\Git\mingw64/etc/gitconfig file aborted the operation, which is probably a bug.

提交回复
热议问题