git commit 时候出现 “fatal: unable to auto-detect email address (got ‘******@.(none)‘)“ 错误
1、起因
重装完系统后,生成ssh密钥并添加到github中后,使用git来提交代码时,使用git commit 命令时出现fatal: unable to auto-detect email address (got ‘…@…(none)’) 错误,如下面:
$ git commit -m "2023-03-24" *** Please tell me who you are. Run git config --global user.email "you@example.com" git config --global user.name "Your Name" to set your account's default identity. Omit --global to set the identity only in this repository. fatal: unable to auto-detect email address (got '...@.....(none)')
2、原因
这是由于未配置github用户名和邮箱所致,我们配置一下github用户名和和邮箱就可以解决了,邮箱是你github的注册邮箱,用户名是你github的用户名
git config --global user.email "XXXXXXX@163.com" git config --global user.name "XXXXXX"
再次运行,就可以成功提交
$ git commit -m "2023-03-24" [master (root-commit) 32dfc26] text commit 1 file changed, 2 insertions(+) create mode 100644 hit.txt
本文作者:Dancing-Pierre
本文链接:https://www.cnblogs.com/wyc-1009/p/17547989.html
版权声明:本作品采用知识共享署名-非商业性使用-禁止演绎 2.5 中国大陆许可协议进行许可。
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步