首页 新闻 会员 周边

git push到github一直提交不了报错error: failed to push some refs to 'git@github.com:userName/gallery-by-react.github.io.git'

0
悬赏园豆:20 [已解决问题] 解决于 2017-11-07 16:48

我这是一个刚在github上新建的项目,然后用git clone下来的,

跟着github上提示的教程走的

…or create a new repository on the command line

echo "# gallery-by-react.github.io" >> README.md
git init
git add README.md
git commit -m "first commit"
git remote add origin git@github.com:zoujian3820/gallery-by-react.github.io.git
git push -u origin master

如示,只要一git push 提交就报下面的错,

Administrator@PC-201612101710 MINGW32 /d/extract/project/gallery-by-react.github.io (master)

$ git push -u origin master
Counting objects: 3, done.
Writing objects: 100% (3/3), 237 bytes | 0 bytes/s, done.
Total 3 (delta 0), reused 0 (delta 0)
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 git@github.com:zoujian3820/gallery-by-react.github.io.git
! [remote rejected] master -> master (push declined due to email privacy restrictions)
error: failed to push some refs to 'git@github.com:zoujian3820/gallery-by-react.github.io.git'

不知道什么原因,百度过一些贴子,

都是说GitHub远程仓库中的README.md文件不在本地仓库中,解决方案为:

git pull --rebase origin master

git push -u origin master

可试了好多遍还是一样的报错,重来也不行,git push -f 强制覆盖远程也不行,

报错内容一直为error: failed to push some refs to 'git@github.com:zoujian3820/gallery-by-react.github.io.git',求解,换别人的电脑也试了一遍, SSH keys 什么的都已经配好了,ssh -T git@github.com检测了下也ok了,求看到的朋友帮忙看看,感激不尽。

MrZou的主页 MrZou | 菜鸟二级 | 园豆:300
提问于:2017-10-26 22:26
< >
分享
最佳答案
0

试试这个

在GitHub的你账号网页上右上角,个人的登录退出的位置,找到setting:

setting->emails->Keep my email address private,把这一项去掉勾选即可。

http://blog.csdn.net/jingfengvae/article/details/72859130

收获园豆:20
Norton.Li | 菜鸟二级 |园豆:220 | 2017-10-27 09:48

非常感谢!!忘了回复,按照你的办法试了下,解决了

MrZou | 园豆:300 (菜鸟二级) | 2017-11-07 16:48
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册