Github 提交报错(push declined due to email privacy restrictions

如果不想关闭隐私设置,可以通过修改 Email 来解决:

  • 使用命令查看当前的全局用户 Email:
git config --global user.email
  • 找到你 GitHub 给的推荐 Email: 在 settting --> Email --> keep my Email private 选项下的 Email; 格式是:{ID}+{username}@users.noreply.github.com

  • 用GitHub 给的推荐 Email重新设置你的全局用户 Email,也可以只设置本个项目的邮箱信息。

git config --global user.email {ID}+{username}@users.noreply.github.com
#or
git config user.email {ID}+{username}@users.noreply.github.com
  • 重置上次提交的作者信息
git commit --amend --reset-author
  • 提交 git push 如果没有其他问题,大功告成。
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容