好奇:git在哪里存储用户信息? [英] curious: where does git store user information?

查看:111
本文介绍了好奇:git在哪里存储用户信息?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想知道git在哪里存储用户信息。我创建了一个存储库,这是我和我的朋友的作品。当我们都承诺时,我们可以看到我们两个人是不同修订版的独立作者。而在他的home文件夹中使用 git config --global 创建的.gitconfig文件中,我找不到一个。那么我的用户信息存储在哪里?是否 git config --global 只影响个人登录用户?

>如果不将用户信息存储在配置文件中Git使用变量 GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_AUTHOR_NAME GIT_AUTHOR_EMAIL 。如果没有这些变量,您的用户名和主机名将用于构建值。因此即使没有任何用户信息存储在配置文件中,两个用户也会有不同的提交者信息。


I'm wondering where does git stores user information. I created a repository, which both me and my friend works on. When we both commit, we can see both of us as individual authors for different revisions. while theres a .gitconfig file created using git config --global in his home folder, I couldn't find one in mine. So where's my user information stored? Does git config --global only affect the individual login user?

解决方案

If you do not store user information in your configuration files Git looks in the environment for committer information, using the variables GIT_COMMITTER_NAME, GIT_COMMITTER_EMAIL, GIT_AUTHOR_NAME, and GIT_AUTHOR_EMAIL. In absence of these variables, your username and host name are used to construct a value. So even without any user information stored in configuration files two users will have different committer information.

这篇关于好奇:git在哪里存储用户信息?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆