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(邮箱)
![](https://img.haomeiwen.com/i14458179/0c4e705fc036dce5.png)
![](https://img.haomeiwen.com/i14458179/c71e886e16d909c9.png)
网友评论