使用webstorm上传代码到github总是出错
发布于 7 年前 作者 15826954460 4531 次浏览 来自 问答

这是上传项目出错 Successfully created project ‘nodejs’ on GitHub, but initial push failed: unable to access ‘https://github.com/15826954460/nodejs.git/’: Failed to connect to 192.168.1.1 port 80 度娘谷歌了各种方法,都试过,还是不知其所以然,依然会有这样的问题

$ ssh-key -t rsa -C "个人邮箱" bash: ssh-key: command not found

柏松@DESKTOP-C0KFRIV MINGW64 ~/Desktop (master) $ ssh-keygen -t rsa -C "个人邮箱" Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/柏松/.ssh/id_rsa): /c/Users/柏松/.ssh/id_rsa already exists. Overwrite (y/n)?

$ ssh-keygen -t rsa -C "个人邮箱" Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/柏松/.ssh/id_rsa):

Overwrite (y/n)? y Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /c/Users/柏松/.ssh/id_rsa. Your public key has been saved in /c/Users/柏松/.ssh/id_rsa.pub. The key fingerprint is: SHA256:4NdTSYR4a3vBIeJJElRQTSVPdnJEN6wPRCPSrC/YhLc 624793604@qq.com The key’s randomart image is: ±–[RSA 2048]----+ | .+=o===O=*…| | . + Oo.o.| | .+.+.+=… | | . oo=o.oo | | . S.=. .o | | o E.o. . | | … | | | | | ±—[SHA256]-----+ ssh -T git@github.com Warning: Permanently added the RSA host key for IP address ‘192.30.255.112’ to t he list of known hosts. Hi 15826954460! You’ve successfully authenticated, but GitHub does not provide s hell access.

以上为通过git和电脑生成ssh,经检查也是成功的,现在不管是提交还是clone都会报 错 unable to access ‘https://github.com/15826954460/nodejs.git/’: Failed to connect to 192.168.1.1 port 80 不知道是各位是否可以给点意见,帮忙解决一下,三天之前还是一切ok, 感激不尽啊!不知道是不是端口号的问题,也不知道如何去配置github和本机的端口号进行配置

5 回复

ping github.com 看看,怎么感觉是 host 被劫持了。

@atian25 好的,谢谢,我去查查

Failed to connect to 192.168.1.1

这ip不对啊,看看电脑的hosts改没改,路由器有没有设置。

@wolfFN 已经解决了,谢谢

@15826954460 客气,不过个人建议可以把root cause和solution分享下,一是后面有朋友搜到,也是个帮助,此外,对个人理解、记忆相信也是有好处的。

回到顶部