Git合并代码问题:Committer identity unknown *** Please tell me who you are

问题描述

由于很久没操作git分支上的代码,最近在idea中做分支合并的时候遇到了如下问题:Committer identity unknown *** 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. unable to auto-detect email address (got 'EDY@WIN-EERRLLM4V43.(none)')

翻译大概意思:提交人身份未知***请告诉我你是谁。运行git-config--global user.email“[email protected]“git-config--global user.name”Your name“用于设置帐户的默认标识。Omit--global仅在此存储库中设置标识。

解决方案

在报错中其实已经说明了解决方案,在执行git操作时,没有设置用户名和邮箱地址导致的,因此解决方案就是设置git提交的账号和邮箱。

直接打开idea的Terminal输入如下两个命令,直接回车即可。

第一个是绑定自己的邮箱。建议使用一个真实存在的邮箱地址。这样,当你提交代码、接收合并请求或进行其他与代码协作相关的操作时,你就能及时收到相关的邮件通知。

第二个就是你提交git的时候的名称,名称随意。

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

如果你只想在当前仓库设置用户信息,可以删掉 --global 参数即可。

你可能感兴趣的:(git)