git 提交 报错 *** Please tell me who you are.

版权声明:阿西莫多 https://blog.csdn.net/yang_yun_hao/article/details/84060767
*** Please tell me who you are.

Run

  git config --global user.email "[email protected]"
  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 'aaa@aa.(none)')

这是Git没有配置当前用户的原因,有两种解决办法

第一种解决办法

    1.打开项目所在目录,找到隐藏的.git文件夹(MAC上不显示隐藏文件,需要用终端命令查看)

     2.打开文件夹内的config文件

     3.添加如下内容到文件末尾

          [user]
                   name = XXX(自己的名称)
                   email = XXXX(邮箱)

第二种解决办法

     直接执行错误提示内的两条命令

  git config --global user.email "你的邮箱地址"
  git config --global user.name "你的名字"

推荐使用第二种办法,能不改动系统文件就尽量不要动。

猜你喜欢

转载自blog.csdn.net/yang_yun_hao/article/details/84060767