我已经在GitHub上接受并合并了一个拉请求,现在我不能再拉我的提交了。
信息是:
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'git@github.com:FranckFreiburger/vue-resize-sensor.git'
git did not exit cleanly (exit code 1) (3838 ms @ 12/04/2017 21:23:11)
我现在该怎么办?
有3个选项你可以使用:
1. 您可以取消勾选GitHub电子邮件设置中的“保持我的电子邮件地址私有”。
2. 如果你想隐藏你的电子邮件库,GitHub在GitHub电子邮件设置中提供了一个无回复的电子邮件地址
因为你启用了电子邮件隐私,
将用于帐户相关的通知以及密码重置。
34661293+aslancan32@users.noreply.github.com将用于
基于web的Git操作,例如编辑和合并。
git config --global user.email "<your-noreply-github-email>"
3-或者你可以使用你的公共电子邮件或商业电子邮件作为你的资料库。像m * * * * @business.com
git config --global user.email "<your-public-email>"
应用到你的设置后,我建议运行重置头代码:
git reset --soft HEAD~1
再次尝试推送存储库
远程存储库已配置为不允许您提交将暴露您的个人电子邮件地址的提交。例如,在GitHub中,你已经选中了Block命令行推送,暴露我的电子邮件复选框来启用此功能。
虽然您当然可以取消勾选该设置,但它将向世界上所有人公开您的私人电子邮件地址,因为任何访问您的存储库的人都可以读取作者信息。
相反,这样做:
You can see your personal e-mail address, which is used by default for your commits in Git:
git config --global user.email
Find your GitHub noreply address in your GitHub's Personal Settings → Emails. It's mentioned in the description of the Keep my email address private checkbox. Usually, it starts with a unique identifier, plus your username:
{ID}+{username}@users.noreply.github.com
Change the global user e-mail address setting to be your GitHub noreply address:
git config --global user.email {ID}+{username}@users.noreply.github.com
Reset the author information on your last commit:
git commit --amend --reset-author
If you have multiple commits with your private e-mail address, see this answer.
Now you can push the commit with the noreply e-mail address, and future commits will have the noreply e-mail address as well.
git push