首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Git不使用user.name

Git不使用user.name
EN

Stack Overflow用户
提问于 2020-05-05 21:44:19
回答 1查看 37关注 0票数 1

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

代码语言:javascript
复制
$ git config --list --show-origin
file:/home/bob/.gitconfig     user.name=Robert DaBuilder
file:/home/bob/.gitconfig     user.email=robert.dabuilder@buildingsite.com
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

当我提交某件事时,我会得到:

代码语言:javascript
复制
$ git commit -m "Add further text"
[master ad1cd5e] Add further text
Author: bob <robert.dabuilder@buildingsite.com>
1 file changed, 2 insertions(+)

那么,在'Author‘字段中,为什么使用我的登录名bob而不是user.name

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2020-05-05 22:56:18

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

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/61614666

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档