Command parameters
--get
Gets the specified configuration item.
--global
For write options: Global configuration, configure the parameters in ~/.gitconfig instead of the. Git/config in the Warehouse directory. For read options: Only the configuration is read from the ~/.gitconfig file.
--local
For write options: Configure the parameters to the. Git/config in the warehouse directory, which is the default setting.
-L,--list
Lists all configuration items in the configuration file.
Configuration file
If the--file option is not specified, there are 4 files for git to configure the query configuration item.
$ (prefix)/etc/gitconfig
System-wide configuration files
~/.gitconfig
A user-specific configuration file, also known as a global profile.
$XDG _config_home/git/config
User-specific secondary configuration files. If $XDG _config_home is not set or empty, $HOME/.config/git/config will be replaced.
$GIT _dir/config
A warehouse-specific configuration file.
Instance
A) Set user name and user message ID
$ git config--global user.name "Huey" $ git config--global user.email "[Email protected]"
b) Set color highlighting
$ git config--global color.ui true
c) List the current configuration options
$ git config--list
More
Http://git-scm.com/docs/git-config
Git Cmd-config:get and set repository or global options