Pro Git Reading Notes - Git Configuration

Storage path for Git configuration files

The git config tool that comes with Git can be used to control configuration variables for how Git looks and behaves. These variables are stored in three different locations. The priority order is: Warehouse > User > System.

1. /etc/gitconfig file: Contains the general configuration of each user and repository in the system. Git will read variables from this file when using the git config command with the --system option.

2. ~/.gitconfig or ~/.config/git/config file: for the current user. Git will read variables from this file if the git config command with the --global option is used.

3. The .git/config file under the current repository.

 

Configure user information through git config

git config --global user.name "Test"

git config --global user.email "[email protected]"

 

View configuration information through git config

git config --list

 

Reference documentation: git-config

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=326139633&siteId=291194637