首页 > git push出错,求帮助?

git push出错,求帮助?

我在win下使用git推送到github遇到了这个问题
请问该怎么解决

$ git push -u origin master
ssh: Could not resolve hostname xxx: 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.

说明你的仓库中配置的 远程仓库的URL地址 所对应的域名,你的电脑解析不出来.


检查下dns,没问题的话检查下你要push到的仓库里是否有你当前机器的公钥。


git remote -v 检查你的origin路径是否合法。一般来说应该为:

ssh://git@<host>:<port>/path_to_source.git 

从报错信息来看,是找不到xxx这个主机;

  1. 确保仓库地址正确

  2. 修改hosts文件,添加host名字和IP的对应关系,或者修改.git/config文件下的origin的url为IP地址

【热门文章】
【热门文章】