Git错误 Please tell me who you are

2022-06-13  本文已影响0人  生命不止运动不息

git提交时,错误如下

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

解决方法

第一种 ,直接设置全局的用户

git config --global user.email "you@example.com"
git config --global user.name "Your Name"

第二种,为项目单独设置

因我的电脑有多个git账户,所以不想通过设置全局邮箱和名字来解决。

进入到项目目录,找到 .git 文件夹,进入到里面,打开config文件。
添加如下三行

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

参考文章

https://blog.csdn.net/qq_46036214/article/details/116275598

上一篇 下一篇

猜你喜欢

热点阅读