How do I show my global Git configuration?

后端 未结 12 2183
遇见更好的自我
遇见更好的自我 2020-12-04 04:28

I\'d like to show all configured Git sections.

I only found git config --get core.editor, and I\'d like to output everything that\'s configured globally

12条回答
  •  感动是毒
    2020-12-04 04:45

    You can also call git config -e to open the configuration file in your editor directly. The Git configuration file is much more readable that the -l output, so I always tend to use the -e flag.

    So to summarise:

    git config -l  # List Git configuration settings (same as --list)
    git config -e  # Opens Git configuration in the default editor (same as --edit)
    
    • Without parameters it interacts with the local .git/config.
    • With --global it interacts with ~/.gitconfig.
    • And with --system it interacts with $(prefix)/etc/gitconfig.

    (I couldn't really find what $(prefix) means, but it seems to default to $HOME.)

提交回复
热议问题