git commit 提交代码失败( unable to auto-detect email address)

git commit 时报错:
需要你认真自己的账户

*** 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 'huangtianhao@huangtianhao.(none)')
解决方法:

1.打开项目所在目录,找到隐藏的.git文件夹
2.在config文件中添加如下:
[user] name = XXX(git名称) email = XXXX(git邮箱)

添加之后,保存,重新执行git commit命令即可

你可能感兴趣的:(Java)