【问题标题】:"Make sure you configure your 'user.email' and 'user.name' in git" when trying to push to git lab尝试推送到 git 实验室时,“确保在 git 中配置了 'user.email' 和 'user.name'”
【发布时间】:2019-07-19 11:02:35
【问题描述】:

当我尝试推送到我的 git 实验室帐户时,我不断收到相同的消息:

“确保你在 git 中配置了你的 'user.email' 和 'user.name'”。

我已经完成了

git config --global user.name "John Doe"

git config --global user.email "johndoe@email.com"

我已经检查过/

git remote -v

有人对我还能做什么有任何想法吗?

【问题讨论】:

  • 一些可能有助于故障排除的信息:(1) 您正在使用什么操作系统? (2) 你用的是什么Git客户端软件?
  • 我想,如果你已经提交了,你应该重新提交,以便作者根据你已经做出的修订得到更正。如果它是一个单一的修订版,您可以使用git commit --amend --author="john doe"(正确的 John Doe 为您的名字)。那么它可能会起作用。
  • 我在 Windows 10 上,我不确定它是什么客户端软件......也许是 git 2.20.1?抱歉,我是 git 新手。
  • 这是我在执行 git commit --amend -- author = "john doe" 错误时得到的结果:pathspec 'author' 与 git 已知的任何文件都不匹配。错误:pathspec '=' 与 git 已知的任何文件都不匹配。错误:pathspec 'amturrietta' 与 git 已知的任何文件都不匹配。
  • @Ashley,我猜是--amend --author="Ashley Turrieta"

标签: git gitlab


【解决方案1】:

您应该在 git commit 上看到该错误消息,而不是 git push,as seen here

确保在 CMD 会话中键入这些命令不是以“管理员”身份启动,而是作为您的常规 Windows 用户帐户。

您可以通过进入您的存储库并输入以下内容来检查该设置是否已设置:

git config -l --show-origin

【讨论】:

    猜你喜欢
    • 2017-06-29
    • 2021-12-18
    • 2016-04-06
    • 2020-08-09
    • 2012-07-27
    • 1970-01-01
    • 2021-02-16
    • 1970-01-01
    • 2012-08-09
    相关资源
    最近更新 更多