So when I try to pull my own github repository I get
"ssh: Could not resolve hostname main: 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."
The repository does exists and I'm pretty sure I do have acces rigths, since I configured my ssh keys following github's documentation and I even did it twice (deleting previous attempt)
The ssh key agent is working and the key is in my keychain, so just being curious I tried pinging github.com and a I get this:
"PING github.com (20.201.28.151) 56(84) bytes of data. ^C --- github.com ping statistics --- 4 packets transmitted, 0 received, 100% packet loss, time 3146ms" Note that I can ping otther servers like google.com
Using the nslookup github.com command:
"Server: 172.31.144.1 Address: 172.31.144.1#53
Non-authoritative answer: Name: github.com Address: 20.201.28.151 "
I'm running Ubuntu 20.04 in WSL2. i'd appreciate any help
CodePudding user response:
Look at your ssh error message:
ssh: Could not resolve hostname main: Name or service not known
You're not trying to reach github.com
. You're trying to reach main
. But ssh has no idea who main
is.
Check your Git and ssh configurations: make sure that your URL (as set in Git) refers to github.com
rather than main
, and then make sure your ssh configuration (in $HOME/.ssh/config
) is not re-mapping host name github.com
to main
.
The lack of ping response is also suspicious, but you'll have to fix the ssh configuration issue before you can get to the next step.