7

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

3
  • 1
    You'll need to show your .git/config file, for starters. Commented Apr 14, 2020 at 13:09
  • The host is not GitHub but github.com Commented Apr 14, 2020 at 13:14
  • [core] repositoryformatversion = 0 filemode = false bare = false logallrefupdates = true symlinks = false ignorecase = true [remote "origin"] url = git@github:Alhiane/alhiane-blog fetch = +refs/heads/*:refs/remotes/origin/* Commented Apr 14, 2020 at 13:40

2 Answers 2

4
git remote set-url origin [email protected]:Alhiane/alhiane-blog
Sign up to request clarification or add additional context in comments.

Comments

-1

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.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.