GIT 在Commit时 提示 Author identity unknown的解决方案

发布时间 2023-05-21 03:09:49作者: 铁憨憨的小小白

GIT 在Commit时 提示 Author identity unknown的解决方案

一、发生事件

在git 新建 commit时 提示 Author identity unknown

二、提示代码

Author identity unknown

*** 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 'xxx@xxx.(none)')

三、解决方案

//直接执行提示的代码
  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"
即可解决

四、其它问题

1,执行了还是提示之前的错误(我真实出现的)

//确认 user.name 、 user.email 这两个参数名是否正确,我就是把 user.email 打成 user.mail 导致的
//执行代码查看信息,确认信息对不对,即可解决
git config --global -l

2,删除配置信息代码

//例子
git config --global --unset user.mail

//说明
git config --global --unset [用户参数名]