git报“commiter email "root@localhost.localdomain"does not match your user account”

首先检查账户邮箱配置是否正确,检查方法:

git config --list

发现邮箱及帐号配置正确,但是git push时仍然报如题错误;

原因:git执行add、commit 时已经记录下了做了该操作时的帐号信息。

解决办法:

确认邮箱帐号配置无误后,将之前已经做的add、commit操作reset 掉,然后再重新add、commit即可;

备注:git 邮箱、帐号配置方法

git config --global user.name "xxx";

git config --global user.email "xxx";

原文地址:https://www.cnblogs.com/noxy/p/8706925.html