好奇:git在哪里存储用户信息? [英] curious: where does git store user information?
问题描述
我想知道git在哪里存储用户信息。我创建了一个存储库,这是我和我的朋友的作品。当我们都承诺时,我们可以看到我们两个人是不同修订版的独立作者。而在他的home文件夹中使用 git config --global
创建的.gitconfig文件中,我找不到一个。那么我的用户信息存储在哪里?是否 git config --global
只影响个人登录用户?
GIT_COMMITTER_NAME
, GIT_COMMITTER_EMAIL $ c在环境中查找提交者信息$ c>, 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屋!