我已经在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)
我现在该怎么办?
远程存储库已配置为不允许您提交将暴露您的个人电子邮件地址的提交。例如,在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