Git未使用user.name

问题描述 投票:1回答:1

我以用户bob的身份通过SSH登录到Linux系统,并且具有

$ git config --list --show-origin
file:/home/bob/.gitconfig     user.name=Robert DaBuilder
file:/home/bob/.gitconfig     [email protected]
file:/home/bob/.gitconfig     color.ui=auto
file:.git/config        core.repositoryformatversion=0
file:.git/config        core.filemode=true
file:.git/config        core.bare=false
file:.git/config        core.logallrefupdates=true
file:.git/config        core.symlinks=false

当我做出某件事时,我得到:

$ git commit -m "Add further text"
[master ad1cd5e] Add further text
Author: bob <[email protected]>
1 file changed, 2 insertions(+)

所以在“作者”字段中,为什么使用我的登录名bob而不是user.name

linux git configuration git-commit
1个回答
0
投票

git使用环境变量GIT_AUTHOR_NAME作为主要信息源,如果未设置,则使用配置值。

© www.soinside.com 2019 - 2024. All rights reserved.