当前位置:   article > 正文

git push -u origin master 报错_git 本地新建无法推送到远端git push -u origin "master" ssh: co

git 本地新建无法推送到远端git push -u origin "master" ssh: could not resolve

 

ssh: Could not resolve hostname git#github.com: Name or service not known
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.

github 报错,

根据查询解决步骤

1、ping github.com  无法ping同

通过IPaddress 查询 到 ip 地址后

修改 C:\Windows\System32\drivers\etc\host.txt  无法保存用管理员打开

140.82.113.4 github.com
199.232.69.194 github.global.ssl.fastly.net   在末尾添加 ip不一定一致 自行查询通过https://www.ip138.com/ 分别查询

修改完整 刷新Dns flush/DNS 能够ping 但还是报错

2、修改Key  通过 git bash 输入 不过先要删除原来

C:\Users\Administrator\.ssh 有 

删除后 git bash 运行

ssh-keygen -t rsa -C "your_email@example.com"

在输入cat ~/.ssh/id_rsa.pub

复制后到github  修改 点击后添加新得key

测试

3 、ssh -T git@github.com

https://stackoverflow.com/questions/26953071/github-authentication-failed-github-does-not-provide-shell-access

You've successfully authenticated, but GitHub does not provide shell access.

尝试重新定义ssh网址以获取远程来源:

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

闽ICP备14008679号