I tried doing git pull --rebase
and I am getting the following error:
ssh: Could not resolve hostname git: nodename nor servname provided, or not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
I tried doing git remote -v
and the origin is properly listed.
How can I fix this error?
In some cases, you're going to inevitably come across errors. And one such error is the “So Such Host is Known” error. As and when you get such error, it implies that either the server is down or the hostname is incorrect and hence SSH wasn't able to connect to it.
This error indicates that your hostname failed to translate into an IP address. Usually, this error occurs when you change the hostname of your system. Please check the details in the Address field as entered by you. Also, check if the hostname of your FTP server and IP address is correct.
Switching remote URLs from HTTPS to SSH Change the current working directory to your local project. List your existing remotes in order to get the name of the remote you want to change. Change your remote's URL from HTTPS to SSH with the git remote set-url command. Verify that the remote URL has changed.
I have recently solved this issue by removing ssh
from the remote address on my fork:
origin ssh://[email protected]:yunus/client.git (fetch)
origin ssh://[email protected]:yunus/client.git (push)
...
updated as:
origin [email protected]:yunus/client.git (fetch)
origin [email protected]:yunus/client.git (push)
...
Just add the hostname to /etc/hosts
file
# IP hostname
1.55.4.5.66 [email protected]
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With