保持我的电子邮件地址不公开 当执行基于Web的Git操作(例如,编辑和合并)并代表您发送电子邮件时, 我们将删除您的公开资料电子邮件,并使用xxxx@users.noreply.github.com。如果要命令行Git操作使用私人电子邮件,则必须 在Git中设置电子邮件。
阻止显示我的电子邮件的命令行推送
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 https://github.com/xxxx/xxxx.git
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'https://github.com/xxxx/xxxx.git'
1、使用命令查看当前的全局用户E-mail
git config --global user.email
2、找到你github给的推荐E-mail. 在settting里面的Emails。
3、重新设置你的全局用户E-mail
git config --global user.email "xxxx-xxxx@users.noreply.github.com"
4、重置上次提交的作者信息
git commit --amend --reset-author
输入命令后,进入vi模式,不熟悉的,可以直接在英文输入法下:wq(冒号wq)保存
5、提交
git push
https://blog.csdn.net/qq_26819733/article/details/78374129 https://stackoverflow.com/questions/43378060/meaning-of-the-github-message-push-declined-due-to-email-privacy-restrictions/43378177