git GitHub 消息的含义:由于电子邮件隐私限制推送被拒绝
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/43378060/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Meaning of the GitHub message: push declined due to email privacy restrictions
提问by Franck Freiburger
I have accepted and merged a Pull Request on github, and now I cannot pull my commits any more.
我已经在 github 上接受并合并了一个 Pull Request,现在我不能再拉我的提交了。
The message is:
消息是:
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to '[email protected]:FranckFreiburger/vue-resize-sensor.git'
git did not exit cleanly (exit code 1) (3838 ms @ 12/04/2017 21:23:11)
What should I do now ?
我现在该怎么办 ?
采纳答案by Jordan Lewis
This is likely caused by a new GitHub settingthat blocks command line pushes that expose your email address.
这可能是由一个新的 GitHub 设置引起的,该设置阻止了暴露您的电子邮件地址的命令行推送。
Try unchecking the "Block command line pushes that expose my email" box in your email settingsand then pushing again.
尝试取消选中电子邮件设置中的“阻止暴露我的电子邮件的命令行推送”框,然后再次推送。
回答by Daniel A.A. Pelsmaeker
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 emailcheckbox to enable this.
远程存储库已配置为不允许您推送会泄露您的个人电子邮件地址的提交。例如,在 GitHub 中,您已选中Block command line pushes that Exposure my email复选框以启用此功能。
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:
相反,请执行以下操作:
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 addressin your GitHub's Personal Settings → Emails. It's mentioned in the description of the Keep my email address privatecheckbox. 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
您可以看到您的个人电子邮件地址,默认情况下您在 Git 中的提交使用该地址:
git config --global user.email
在 GitHub 的Personal Settings → Emails 中找到您的GitHub noreply 地址。在“保持我的电子邮件地址私密”复选框的描述中提到了这一点。通常,它以唯一标识符开头,加上您的用户名:
{ID}+{username}@users.noreply.github.com
将全局用户电子邮件地址设置更改为您的 GitHub noreply 地址:
git config --global user.email {ID}+{username}@users.noreply.github.com
重置上次提交的作者信息:
git commit --amend --reset-author
如果您的私人电子邮件地址有多个提交,请参阅此答案。
现在您可以使用 noreply 电子邮件地址推送提交,未来的提交也将具有 noreply 电子邮件地址。
git push
回答by Ndirangu Waweru
I solved the errors by:
我通过以下方式解决了错误:
git config --global user.email ""
git config --global user.email ""
This just set my email to blank (an empty string). I now set my email in individual projects with:
这只是将我的电子邮件设置为空白(空字符串)。我现在在单个项目中设置我的电子邮件:
git config user.email "[email protected]"
git config user.email "[email protected]"
回答by Anjani Barnwal
- just go to github.com and click on your profile
- goto settings
- now click on the 'Email' on left navigation panel
- and search for the field 'Keep my email addresses private'
- please uncheck this option
- now please check again and i think your problem is solved now.
- 只需访问 github.com 并单击您的个人资料
- 前往设置
- 现在点击左侧导航面板上的“电子邮件”
- 并搜索“将我的电子邮件地址保密”字段
- 请取消选中此选项
- 现在请再次检查,我认为您的问题现在已经解决了。
回答by Rajesh Panda
Uncheck Block command line pushes that expose my emailand then try pushing the code from command line.
取消选中公开我的电子邮件的阻止命令行推送,然后尝试从命令行推送代码。