GitHub消息的含义:由于电子邮件隐私限制,推送被拒绝 [英] Meaning of the GitHub message: push declined due to email privacy restrictions

查看:351
本文介绍了GitHub消息的含义:由于电子邮件隐私限制,推送被拒绝的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在GitHub上接受并合并了一个拉取请求,现在我不能再拉出提交了.

I have accepted and merged a pull request on GitHub, and now I cannot pull my commits any more.

消息是:

! [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中,您已检查> 阻止命令行公开我的电子邮件 复选框以启用此功能.

The remote repository has been configured to disallow you pushing a commit that would reveal your personal e-mail address. For example in GitHub you have checked the Block command line pushes that expose my email checkbox to enable this.

您当然可以取消选中该设置,但是它将向世界上的每个人公开您的私人电子邮件地址,因为任何有权访问您的存储库的人都可以阅读作者信息.

While you can of course uncheck that setting, it will expose your private e-mail address to everyone in the world, as author information is readable by anyone with access to your repository.

相反,请执行以下操作:

Instead, do this:

  1. 您可以看到您的个人电子邮件地址,默认情况下,该电子邮件地址用于您在Git中的提交:

  1. You can see your personal e-mail address, which is used by default for your commits in Git:

git config --global user.email

  • 在以下位置找到您的 GitHub noreply地址您的GitHub的个人设置→电子邮件. 将我的电子邮件地址保留为私有复选框的描述中提到了此内容.通常,它以唯一标识符开头,再加上您的用户名:

  • 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
    

    将全局用户电子邮件地址设置更改为您的GitHub noreply地址:

    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.

    现在您可以使用noreply电子邮件地址推送提交,以后的提交也将具有noreply电子邮件地址.

    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消息的含义:由于电子邮件隐私限制,推送被拒绝的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆