Kermit the Frog
Kermit the Frog

Reputation: 3969

Could not resolve hostname git: nodename nor servname provided, or not known

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?

Upvotes: 16

Views: 47900

Answers (3)

Junius L
Junius L

Reputation: 16152

Just add the hostname to /etc/hosts file

# IP       hostname
1.55.4.5.66 [email protected]

Upvotes: 2

Yunus Nedim Mehel
Yunus Nedim Mehel

Reputation: 12389

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)
...

Upvotes: 11

ryan
ryan

Reputation: 875

I had run into the same error. Fix it by switching to another DNS server.

You can try Google DNS

  • 8.8.8.8
  • 8.8.4.4

Get answer from here

Upvotes: 1

Related Questions