本文最后更新于 329 天前,如有失效请评论区留言。
remote: error: GH007: Your push would publish a private email address.
remote: You can make your email public or disable this protection by visiting:
remote: http://github.com/settings/emails
To github.com:BIMiracle/WordPress.git
! [remote rejected] main -> main (push declined due to email privacy restrictions)
error: failed to push some refs to ‘github.com:BIMiracle/WordPress.git’
原因是设置了邮箱隐私,提交时检测到你使用了真实邮箱
在Github中点Settings-Emails , 红框部分就是你的隐藏后的邮箱地址
执行命令
git config --global user.email "[email protected]"
执行后如果还是报错需要刷新一下提交者信息
git commit --amend --reset-author
或者如果不想隐藏邮箱可以将 Keep my email addresses private取消勾选