为了能到远方,脚下的每一步都不能少.|

Dancing-Pierre

园龄:1年10个月粉丝:3关注:0

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 中国大陆许可协议进行许可。

posted @   Dancing-Pierre  阅读(38)  评论(0编辑  收藏  举报  
点击右上角即可分享
微信分享提示
评论
收藏
关注
推荐
深色
回顶
收起