'ssh: Could not resolve hostname github: nodename nor servname provided, or not known
I followed instructions here to the letter https://docs.github.com/en/authentication/connecting-to-github-with-ssh
I run the following (my username entered at <myname> )
git remote add origin [email protected]:<myname>/aws-bootstrap.git
I then get fatal: remote origin already exists.
Then I run git push -u origin master
ssh: Could not resolve hostname github: 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.
Any ideas what could be wrong?
Solution 1:[1]
The error could be caused by a number of things, as others have mentioned though, its likely that your origin remote is configured incorrectly. If so, this thread has some useful context:
git - remote add origin vs remote set-url origin
I find sometimes it can be easier to manually inspect/edit the <project dir>/.git/config file as well incase a typo was made somewhere.
Regarding the access rights message
Please make sure you have the correct access rights and the repository exists.
if your <project dir>/.git/config looks good, make sure your SSH private/public key are configured correctly both locally and on GitHub.
It may be helpful to print both SSH and git logs if neither of those suggestions resolve the problem:
$ GIT_SSH_COMMAND="ssh -vvv" $GIT_TRACE=1 git push -u origin master
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | deric4 |
