新电脑连接远程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: empty ident name (for <peng_@LAPTOP-50UB5IJ5>) not allowed

报错翻译如下:

***请告诉我你是谁。

运行

git config --global user.email”邮箱”
git config --global user.name”你的名字”

设置帐户的默认标识。
省略—全局仅在这个存储库中设置标识。

致命错误:无法自动检测电子邮件地址(有peng_ @ laptop-50ub5ij5。(无)”)

原因:

git库不认识现在这台电脑是谁,需要把自己的公钥名或者邮箱告诉git库。

解决方法:

git config --global user.email "邮箱"
git config --global user.name "公钥名"
# user.name后面添加上公钥的用户名
posted @ 2018-02-27 11:40  阿鹏2019  阅读(485)  评论(0编辑  收藏  举报