git提示错误关于错误:ssh: Could not resolve hostname github.com: Name or service not known.fatal: Could not read from remote repository.

关于 Git 使用中出现的错误

饥人谷_楠柒 关注

2016.11.02 15:33* 字数 746 阅读 3607评论 5喜欢 10赞赏 1

关于错误:ssh: Could not resolve hostname github.com: Name or service not known.fatal: Could not read from remote repository.

QQ截图20161102144048.jpg

在我配置完公钥后想要进行远端Github上clone时出现了错误。经过网上查询发现在配置git时要验证是否成功。要在git bash 下输出$ ssh -T [email protected]如果是第一次的会提示是否continue,输入yes就会看到:You’ve successfully authenticated, but GitHub does not provide shell access 。这就表示已成功连上github。

但是 我输入后并不是这样的,我的显示Host key verification failed.于是查询中。。。。。
经查找后发现我在git bash 下打出ping github.com 不显示ip。之前对git使用并不太了解。也在网上查找了相关错误的解决办法但都没有用。(如该DNS等等)最后还是找到了问题的所在。

如果有朋友出现了以下三条错误可以按我下面的操作试试。
错误1.

QQ截图20161102144048.jpg

clone
ssh:无法解析主机名github.com:名称或服务不知道
无法读取远程存储库。
请确保您有正确的访问权限
和存储库存在。(错误代码)

错误2.
在git bash 下输出$ ssh -T [email protected]也显示错误。(表示git连接github失败)

错误3.
在git bash 下打出ping github.com 不显示ip。

原因有可能是本地DNS无法解析导致的。造成该问题的因素可能有多种,安全防护类软件、病毒、优化或清理等导致本地DNS解析文件被清除或更改,DNS缓存问题,Winsock目录问题等。

解决办法

  1. 先去复制一下别人的hosts 该文件在C:\Windows\System32\drivers\etc路径下
    把复制的文件放入该路径下 原来的不要

    QQ截图20161102151526.jpg

  2. 进入cmd (开始->搜索文件和程序->打入cmd->enter)
    输入:ipconfig /flushdns 释放DNS缓存。
    输入:netsh winsock reset 重置Winsock目录。
    会有提示:必须重启计算机才能完成重置。
    先不要着急重启。
  3. 在cmd里随意ping一个网址试试(如图)

QQ截图20161102152243.jpg

无丢失表示成功了。再重启你的计算机。

  1. 重启后进入你的git bash 试试 ping github.com
    应该会显示你的ip地址。在git bash下输出$ ssh -T [email protected]如果是第一次的会提示是否continue,输入yes就会看到:You’ve successfully authenticated, but GitHub does not provide shell access 。这就表示已成功连上github。
  2. 之后你的git clone就不会出现错误提示(
    ssh: Could not resolve hostname 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.

这只是我个人在使用git时碰到的问题,希望能够帮助其他朋友。如果有朋友再使用git时还碰到其他解决不了的问题希望我可以帮到你(请留言)。建议碰到问题先在网上自己查询,虽然很浪费时间但问题的所在和解决的办法或让你难以忘怀!!

原文地址:https://www.cnblogs.com/niuniui/p/8783273.html

时间: 2024-10-10 04:33:47

git提示错误关于错误:ssh: Could not resolve hostname github.com: Name or service not known.fatal: Could not read from remote repository.的相关文章

ssh: Could not resolve hostname问题终于解决了?

1.如果系统为64位,无法启动启动hdfs: ./sbin/start-dfs.sh.并有以下错误: sed: -e expression #1, char 6: unknown option to `s' HotSpot(TM): ssh: Could not resolve hostname HotSpot(TM): Name or service not known 64-Bit: ssh: Could not resolve hostname 64-Bit: Name or servic

ssh: Could not resolve hostname git.*****-inc.com : Temporary failure in name resolution fatal: The remote end hung up unexpectedly

问题出现的情景:使用git pull拉取开发的代码到测试服务器,报错: ssh: Could not resolve hostname git.****-inc.com : Temporary failure in name resolution fatal: The remote end hung up unexpectedly 解决: 1.确定本地的ssh相关的文件是正确的(参考[本地服务器配置Git]) 2.尝试了网上的方法,不是没root权限无法执行就是没解决问题,后来找运维解决了 原因

ssh修改默认端口号后无法连接(提示ssh: Could not resolve hostname)

ssh命令语法:usage: ssh [-46AaCfGgKkMNnqsTtVvXxYy] [-B bind_interface][-b bind_address] [-c cipher_spec] [-D [bind_address:]port][-E log_file] [-e escape_char] [-F configfile] [-I pkcs11][-i identity_file] [-J [[email protected]]host[:port]] [-L address][

【git基础】Permission denied (publickey). fatal: Could not read from remote repository

运行以下git命令的时候出现错误 git push -u origin master error The authenticity of host 'github.com (13.250.177.223)' can't be established. RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8. Are you sure you want to continue connecting (yes

ssh: Could not resolve hostname gitcafe.com: nodename nor servname provided, or not known

今天 git push 的时候报如下错误: ssh: Could not resolve hostname gitcafe.com: nodename nor servname provided, or not known fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. 最开始还以为是权限被修改了

git之fatal: Could not read from remote repository

问题背景:在git bash中使用hexo g -d命令进行文章发布 详细错误信息: fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists. FATAL Something's wrong. Maybe you can find the solution here: http://hexo.io/docs

git pull 出错 fatal: Could not read from remote repository.Please make sure you have the correct access rights.and the repository exists.

Warning: Permanently added the RSA host key for IP address '192.30.252.131' to the list of known hosts. Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repositor

fatal:'origin' does not appear to be a git repository fatal:Could not read from remote repository

天gitlab中遇到的问题: 当 git push origin branch_name时遇到报错如下: fatal:'origin' does not appear to be a git repository fatal:Could not read from remote repository 原因: 本地分支和远程分支断开连接 解决方法: cd 本地分支里1.git branch                ——*master   只显示master 然后查看是否从上游拉了2.git

hadoop启动报错:localhost: ssh: Could not resolve hostname localhost

hadoop启动journalnode时报错:localhost: ssh: Could not resolve hostname localhost: Temporary failure in name resolution 解决办法:将高亮部分补充到/etc/profile中,然后source生效 export JAVA_HOME=/opt/module/jdk1.8.0_144 export HADOOP_HOME=/opt/ha/hadoop-2.7.4 export HADOOP_CO