Git推送错误 - 无法解析主机名称 [英] Git Push Error - Could not resolve host name

查看:111
本文介绍了Git推送错误 - 无法解析主机名称的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

  nshastri @ N-SHASTRI〜/ datasciencecoursera(master)
$ git push origin master


$ b


ssh:无法解析主机名https:没有与名称关联的地址

致命:无法请阅读远程存储库。



请确保您拥有正确的访问权限
并存在存储库。



解决方案

只需输入:

  git remote -v 

并仔细检查与原点用于您的上游回购



一旦拥有正确的URL,用另一个 git remote 命令

  git remote set-url origin / the / right / url 
code>

在你的情况下,url是错误的:

  https:/github.com/nkshastri/da​​tasciencecoursera.git 
#而不是:
https://github.com/nkshastri/da​​tasciencecoursera.git
^^^^

只需输入:

  git remote set-url origin https://nkshastri@github.com/nkshastri/da​​tasciencecoursera 

然后再试一次:

  git push -u origin master 

(with master ,而不是 maaster


nshastri@N-SHASTRI ~/datasciencecoursera (master)
$ git push origin master

ssh: Could not resolve hostname https: no address associated with name

fatal: Could not read from remote repository.

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

解决方案

Simply type:

git remote -v

and double-check the url associated with origin for your upstream repo.

Once you have the right url, update your remote origin with another git remote command:

git remote set-url origin /the/right/url

In your case, the url is wrong:

https:/github.com/nkshastri/datasciencecoursera.git
# instead of:
https://github.com/nkshastri/datasciencecoursera.git
     ^^^^

Simply type:

git remote set-url origin https://nkshastri@github.com/nkshastri/datasciencecoursera

Then try again:

git push -u origin master

(with master, not maaster)

这篇关于Git推送错误 - 无法解析主机名称的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆