Git Push Error - Could not resolve host name

匿名 (未验证) 提交于 2019-12-03 02:49:01

问题:

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.

回答1:

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)



回答2:

Sometimes this can be caused by a network issue. Try restarting your wifi or, if the repository is behind a VPN, make sure you are on the VPN.



回答3:

You are probably trying to connect a FALSE NAME DIR your repository name should be the SAME as your folder name in local environment.

git repo: gitRepo folder name: gitRepo now you can push

it is also a good practice to first CLONE your new repository to a different folder and then you can COPY your code to this new folder and then change its name to the right git repository name.



标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!