Alhiane
Alhiane

Reputation: 131

git SSH : Could not resolve hostname github: Name or service not known fatal: Could not read from remote repository

git SSH: $ git push -u origin master ssh: Could not resolve hostname GitHub: Name or service not known fatal: Could not read from remote repository. Please make sure you have the correct access rights and the reposit

Any Solution, please

Upvotes: 7

Views: 20308

Answers (2)

Dohn Joe
Dohn Joe

Reputation: 325

Just for the sake of completeness, I encountered a similar issue today: Running git pull ending with the error message ssh: Could not resolve hostname github.com.

Ping also reported 100% packet loss. However, after a few minutes the issue went away. So, sometimes this issue is indeed temporary as the first error message suggested. Especially in cases, when nothing on the user's side changed.


Added to add, that I again encountered this behaviour. I called git push from within the repo after making a commit and got an error. A little while later, I repeated the command and it worked.

Here's a copy from my Terminal with all personal data removed.

user@host:~/myGitHubRepo/somePath$ git push
ssh: Could not resolve hostname github.com: Name or service not known
fatal: Konnte nicht vom Remote-Repository lesen.

Bitte stellen Sie sicher, dass die korrekten Zugriffsberechtigungen bestehen
und das Repository existiert.
user@host:~/myGitHubRepo/somePath$ git push
Zähle Objekte: 7, Fertig.
Delta compression using up to 8 threads.
Komprimiere Objekte: 100% (6/6), Fertig.
Schreibe Objekte: 100% (7/7), 677 bytes | 677.00 KiB/s, Fertig.
Total 7 (delta 4), reused 0 (delta 0)
remote: Resolving deltas: 100% (4/4), completed with 4 local objects.
To github.com:myGitHubRepo.git
   04c0b15..817145d  master -> master

Sorry for the partly German error messages.

My computer is a PC which is connected by cable to our LAN. I expect a cabled network to be less brittle than a wireless one, but maybe the network was somewhat(?) down when I first called git push, I don't know.

While the error message from ssh might hint to a network problem, git was a bit more enigmatic. Git's message roughly translates to: make sure you have got the proper permissions and that the repository exists.

Upvotes: -1

phd
phd

Reputation: 95091

git remote set-url origin [email protected]:Alhiane/alhiane-blog

Upvotes: 4

Related Questions