I encountered this problem when using git to push to github under win
How to solve it
$ 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.
人生最曼妙的風(fēng)景,竟是內(nèi)心的淡定與從容!
git remote -v checks whether your origin path is legal. Generally speaking it should be:
ssh://git@<host>:<port>/path_to_source.git
Judging from the error message, the host xxx cannot be found;
Make sure the warehouse address is correct
Modify the hosts file and add the corresponding relationship between the host name and IP, or modify the origin url under the .git/config file to the IP address
Check the dns. If there is no problem, check whether the public key of your current machine is in the warehouse you want to push to.