Git 全局配置用户依赖于系统账户?

Git global config user depends on system account?

Centos 6,Git2.0.4

在服务器上为另一个开发人员设置 git,我以系统根用户的身份进行了设置:

root@server $ git config --global user.name "My Dev Guy"
root@server $ su mydevguy
mydevguy@server $ git config --list

没有设置用户!所以,作为系统用户 "mydevguy" 我做了:

mydevguy@server $ git config --global user.name "Some Other Guy"
mydevguy@server $ git config --list

显示 "Some Other Guy" 作为用户名,正如预期的那样。所以我退出回到系统 root 用户,看看那里有什么。

mydevguy@server $ exit
root@server $ git config --list

它仍然显示 "My Dev Guy"。

我以为这些是全局 git 设置,但似乎可以为每个系统用户配置 git 个用户。是这样吗?我在哪里可以阅读更多相关信息?

When reading, the values are read from the system, global and repository local configuration files by default, and options --system, --global, --local and --file <filename> can be used to tell the command to read from only that location

不同位置的意思;

--local Use the repository .git/config file (per repository)
--global Use the global ~/.gitconfig file (per user)
--system Use the system-wide $(prefix)/etc/gitconfig (per system)

--local写入默认,读取默认读取所有文件。

Reference.