【问题标题】:fatal: unable to auto-detect email address (got 'M S@folder.(none)')致命:无法自动检测电子邮件地址(得到 'M S@folder.(none)')
【发布时间】:2021-06-30 06:02:08
【问题描述】:

我只是无法使用 git bash 在 github 上添加文件

错误信息:

fatal: unable to auto-detect email address (got 'M S@folder.(none)')

我试过这个命令:

git commit -m "first commit" filename

有什么帮助吗?

【问题讨论】:

  • 运行 git config --global --listuser.nameuser.email 返回什么?
  • 这能回答你的问题吗? git: fatal unable to auto-detect email address
  • error: src refspec master does not match any error: failed to push some refs to 'github.com/muradmohd01/TestGit.git' 这个消息显示怎么办??
  • 看起来默认分支设置为 main 或任何其他名称,而不是 master。请确认您是否属于这种情况。消息表明 refspec 不知道 master。请运行git show-ref 看看它是返回主还是主

标签: git-commit git-config


【解决方案1】:

当您第一次在系统中安装 git 时,您必须设置您的用户名和电子邮件。您可以使用以下给定的命令设置您的凭据。

$ git config --global user.email "email_id"

$ git config --global user.name "user_name"

【讨论】:

    猜你喜欢
    • 2014-10-29
    • 1970-01-01
    • 1970-01-01
    • 2021-06-08
    • 1970-01-01
    • 2012-04-08
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多