English 中文(简体)
Git承诺提供作者信息 - 到底谁是Christian S?
原标题:Git commit author information - Who the heck is Christian S.?
  • 时间:2012-05-25 06:00:20
  •  标签:
  • git

我最近开始使用 Git 。 我试图按照指示设置我的用户信息, 但似乎有可怕的错误:

[test@h] git config --list
user.name=**MY NAME**
user.email=**MY EMAIL**
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
remote.origin.url=** URL **
branch.master.remote=origin
ranch.master.merge=refs/heads/master

到目前为止, 都很好。 我的名字 & amp; 电子邮件地址似乎设置正确 。

[test@h] git add somefile

我添加了一个文件, 现在想要承诺:

[test@h] git commit -m "test commit"     
[master 280efe4] test commit
Author: Christian S. <strcat@****.com>
1 file changed, 0 insertions(+), 0 deletions(-)
create mode 100644 somefile

突然不知从哪冒出来...

我忽略了什么? 我没有这个名字和电子邮件地址的来源。 我忘了在某个地方重置这个默认值吗?

EDIT: 被删除的个人信息

最佳回答

我当时在开发服务器上工作, 那里有一个系统宽的.zshrc文件。

显然,.zshrc文件的来源是:http://www.strcat.de/dotfiles/dot.zshexports

在此文件中, 作者姓名和电子邮件地址被硬编码 :

if [[ -x `which git` ]]; then
   (( ${+GIT_AUTHOR_EMAIL} )) || export GIT_AUTHOR_EMAIL = "..."
       ...
问题回答

这些是什么给你的:

git config --system -l
git config --global -l
git config --local -l

或在 Linux 中:

echo $GIT_AUTHOR_NAME

在 Windows 中 :

echo %GIT_AUTHOR_NAME%

打开 your- repo/.git/ config 的配置文件,检查那里是否有[用户]设置。

存储库中的配置文件将覆盖全局. gitconfig 文件 。





相关问题
git confusion - cloning a repo is returning a past version

Im having some confusion with my git usage. I cloned a repo from one comp to the other, and the new clone is the state of the original that was active some time ago. So its cloning a past version. ...

Appropriate strategy for tagging and hotfixing with git

I was wondering if the strategy I m using for tagging and hotfixing tags (which then I use for deploying rails applications) with git is appropriate. For tagging I just tag a commit of the master ...

Tips on upgrading CVS to git/hg?

We still use CVS, I use git and hg for my personal use though I m still a novice at both, but I realize they re much more modern and better, faster, distributed, etc. It s just everyone is so ...

Using Git in a TFS shop

Using Git at home has spoiled me - I now find using TFS at work to be a bit of a drag and want to explore the possibility of using Git locally and syncing somehow with TFS. I figure there are a few ...

热门标签