当前位置:   article > 正文

push declined due to email privacy restrictions 解决方法_! [remote rejected] head -> main (push declined du

! [remote rejected] head -> main (push declined due to repository rule viola

push declined due to email privacy restrictions 解决方法

将本地仓库 push 到 github 报错:

异常信息:

! [remote rejected] main -> main (push declined due to email privacy restrictions)

异常原因:配置 git 时设置了作者邮箱信息,触发了Github 隐私保护设置: Block command line pushes that expose my email

解决方法:

1、关闭 setttings => Emails => Block command line pushes that expose my email 这个选项【不推荐】

2、更改 git 配置的邮件地址

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

2、 setttings => Email => keep my Email private 选项下的 Email; 格式是:id+username@users.noreply.github.com

3、重新设置全局用户 Email: git config --global user.email “GitHub 给的推荐 Email”

4、重新提交 git push

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/IT小白/article/detail/792181
推荐阅读
相关标签
  

闽ICP备14008679号