Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Git Push Error - Could not resolve host name

Tags:

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.

like image 418
Narendra Kumar Shastri Avatar asked Sep 19 '14 10:09

Narendra Kumar Shastri


People also ask

Could not resolve host GitHub Push?

This can be caused by incorrect proxy settings, or error typing names, make sure you're using the exact URL of whatever you're trying to do. Try these commands. Also set user- name and user-email. Hope this will solve your error.

Why is git push being rejected?

A commit gets rejected and causes a failed to push some refs to error because the remote branch contains code that you do not have locally. What this means is that your local git repository is not compatible with the remote origin. Based on the above, your local machine is missing commits C and D.

What does could not resolve host mean?

What is the meaning of error: 'Unable to resolve host name'? This error means that the hostname you are trying to connect to cannot be resolved to an IP address. (Hostnames are resolved to IP addresses by a DNS (Domain NameServer)). Please check what you have entered in the Address field.

Could not resolve hostname name or service not known fatal could not read from remote repository?

The Git “fatal: Could not read from remote repository” error occurs when there is an issue authenticating with a Git repository. This is common if you have incorrectly set up SSH authentication. To solve this error, make sure your SSH key is in your keychain and you connecting to a repository using the correct URL.


1 Answers

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://[email protected]/nkshastri/datasciencecoursera 

Then try again:

git push -u origin master 

(with master, not maaster)

like image 133
VonC Avatar answered Sep 17 '22 21:09

VonC