一、问题描述
将项目更新内容Push
到远程仓库上时,显示提交失败:
二、问题分析
这是由于Github
出于隐私性考虑在执行Git Push
时,将不再需要你的真实邮箱,而是在Github Email settings中提供了一个掩码邮箱地址,格式为
{ID}+{username}@users.noreply.github.com
比如我的是:
三、解决方案
1.修改当前的git email
把git email
地址修改为刚刚那个地址,注意--global
修饰符
git config --global user.email {ID}+{username}@users.noreply.github.com
2. 重置上一次提交
在你要提交的项目工作目录下打开 git bash
,将重置内容附加到上一次提交:
git commit --amend --reset-author