我已经在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

其他回答

这可能是由于一个新的GitHub设置阻止命令行推送暴露你的电子邮件地址。

试着取消勾选电子邮件设置中的“阻止命令行推送暴露我的电子邮件”框,然后再按一次。

我通过以下方法解决了错误:

Git配置——全局用户。邮件“”

这只是将我的电子邮件设置为空白(空字符串)。我现在在各个项目中设置电子邮件:

转到配置 user.email“myemail@domain.com”

打开github.com的电子邮件部分。访问https://github.com/settings/emails。 去保密我的电子邮件地址部分,并记下你不回复的电子邮件id。 打开git终端,使用以下命令设置你的donotreply邮箱id为你的邮箱id:

git config --global user.email "<your_donotreply_email_id"

恢复您最近的本地提交(使用您的私人电子邮件),这些提交无法推送到存储库。

git reset --soft HEAD~1 

分期并推送这些提交

git add .
git commit –m "<commit_message>"
git push

使用Github桌面解决了我的问题。

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