因为来公司用的是别人之前用的电脑,先前设置过邮箱和用户名,导致提交代码时显示别人的名字
然后查了一些资料找到了解决方法:
1、随便打开一个文件夹,右键git bash here, 输入git config --list, 会显示一串信息
底下会有user.name 和user.email, 这两行的名字和邮箱肯定不是你的
2、自行修改,输入:git config --global user.name "你的用户名"(这里不要加引号)
输入:git config --global user.email "你的邮箱"(不加引号)
3、检查一遍,重新输入git config --list, 显示的 user.name和user.email应该就是你自己的了
4、如果还是报错了,请输入:git config --global --replace-all user.email "你的邮箱"
输入:git config --global --replace-all user.name "你的用户名"
5、这样就不会有什么问题了