General configuration of user level configuration
Git configuration from top to bottom three layers system / global / local, three different parameters are set, the configuration of each level is stored in a different location,
1) ./ etc / gitconfig file: contains apply to all users and all library system value. If you pass a parameter option '--system' to git config, it will be clear to read and write this file. (System level configuration) System
. 2) ~ / .gitconfig file: Specific to your user. You can make Git read or write this particular file by passing --global option. (User-level configuration) global
3) located git directory config files (that is, .git / config):. Whether you are currently in use libraries What is the specific point of the single library. Each level rewrite the previous level of value. Thus, the value in .git / config covers the same value in the / etc / gitconfig in. (Warehouse level configuration) local
Usually we only configure global level
[root @ CI-node1 ~] # git config --global user.name " Your the Name " // configure the user in order to know who submitted the code [root @ ci-node1 ~] # git config --global user. [email protected] Email // configure mailbox in order to contact the person to submit code
After the configuration global configuration, creates .gitconfig file in the user's home directory
I was at the root account /root/.gitconfig
View the file contents
[root@ci-node1 ~]# cat .gitconfig [user] name = "name" email = "email"
View profile
[root@ci-node1 ~]# git config --list user.name="name" user.email="email"
[CI-node1 the root @ ~ ] # Git config Usage: Git config [Options] Config File LOCATION --global use config Global File // global configuration --system use config System File // system configuration --local use Repository config File // warehouse configuration