【问题标题】:Why is github showing different authorname?为什么github显示不同的作者名?
【发布时间】:2015-05-29 19:03:13
【问题描述】:

我克隆了我的代码的新仓库。 然后我在 repo 中进行了必要的更改,然后执行了这三个步骤

git add --all
git commit
git push -u origin master

它询问用户名、密码,我输入。

但是在推送之后,git repo 显示的更改是由我的同事而不是我所写的。为什么这样? 拿不到。

【问题讨论】:

  • 您是否更改了 Git 中的配置设置?您可能还想使用 SSH 简化推送到 GitHub。
  • 可能是你不小心用同事的用户名登录了?
  • git config --list | grep user 是否显示您的姓名或您同事的姓名?

标签: git github author


【解决方案1】:

检查配置中的电子邮件是什么

git config --global user.email

如果不是你的,请更改并再次提交:

$ git config --global user.name "John Doe"
$ git config --global user.email johndoe@example.com

【讨论】:

  • git config --list --global 可能也有用
  • 确实是全局配置问题!它被配置为我同事的姓名和电子邮件。作为 git 的新手,我很难弄清楚。非常感谢!
【解决方案2】:

当您执行git log 时,它是否在本地将您提交的作者显示为您的同事?

您可以通过运行以下命令来检查“您以谁的身份提交”:

git config user.name

git config --global user.name

还有ensure your email is properly associated with your GitHub account。您可以通过同样的方式检查您的本地电子邮件地址设置:

git config user.email

git config --global user.email

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-07-25
    • 1970-01-01
    • 1970-01-01
    • 2015-01-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-01-20
    相关资源
    最近更新 更多