前往小程序,Get更优阅读体验!
立即前往
首页
学习
活动
专区
工具
TVP
发布
社区首页 >专栏 >github启用了隐私邮箱后如何git push

github启用了隐私邮箱后如何git push

作者头像
wo.
发布2021-06-15 11:45:08
1.6K0
发布2021-06-15 11:45:08
举报
文章被收录于专栏:了不得的专栏
启用了下面这两个

保持我的电子邮件地址不公开 当执行基于Web的Git操作(例如,编辑和合并)并代表您发送电子邮件时, 我们将删除您的公开资料电子邮件,并使用xxxx@users.noreply.github.com。如果要命令行Git操作使用私人电子邮件,则必须 在Git中设置电子邮件。

阻止显示我的电子邮件的命令行推送

报错
代码语言:javascript
复制
remote: error: GH007: Your push would publish a private email address.
remote: You can make your email public or disable this protection by visiting:
remote: http://github.com/settings/emails
To https://github.com/xxxx/xxxx.git
 ! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'https://github.com/xxxx/xxxx.git'
修改邮箱

1、使用命令查看当前的全局用户E-mail git config --global user.email

2、找到你github给的推荐E-mail. 在settting里面的Emails。

3、重新设置你的全局用户E-mail git config --global user.email "xxxx-xxxx@users.noreply.github.com"

4、重置上次提交的作者信息 git commit --amend --reset-author 输入命令后,进入vi模式,不熟悉的,可以直接在英文输入法下:wq(冒号wq)保存

5、提交 git push

参考

https://blog.csdn.net/qq_26819733/article/details/78374129 https://stackoverflow.com/questions/43378060/meaning-of-the-github-message-push-declined-due-to-email-privacy-restrictions/43378177

本文参与 腾讯云自媒体同步曝光计划,分享自作者个人站点/博客。
原始发表:2019-12-31,如有侵权请联系 cloudcommunity@tencent.com 删除

本文分享自 作者个人站点/博客 前往查看

如有侵权,请联系 cloudcommunity@tencent.com 删除。

本文参与 腾讯云自媒体同步曝光计划  ,欢迎热爱写作的你一起参与!

评论
登录后参与评论
0 条评论
热度
最新
推荐阅读
目录
  • 启用了下面这两个
  • 报错
  • 修改邮箱
  • 参考
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档