簡體   English   中英

ssh:無法解析主機名 github.com:名稱解析暫時失敗

[英]ssh: Could not resolve hostname github.com: Temporary failure in name resolution

回購是在開始時使用 SSH 克隆的。 直到今天,我都沒有問題推送到 Github。 我一整天都在嘗試解決這個錯誤,但我仍然無法解決這個錯誤。如果有人能對此有所了解,那就太好了:謝謝 :)

2dsnakegame git:(main) git push origin main
ssh: Could not resolve hostname github.com: Temporary failure in name resolution
fatal: Could not read from remote repository.

Please make sure you have the correct access rights
and the repository exists.
➜  2dsnakegame git:(main) git remote
origin
➜  2dsnakegame git:(main) git remote --v
origin  git@github.com:xxxx/2dsnakegame.git (fetch)
origin  git@github.com:xxxx/2dsnakegame.git (push)

我在使用 WSL2 的 Windows 上遇到了同樣的情況。 看起來與 DNS 服務器的連接出現問題,所以我基本上使用以下命令重置了我的 TCP/IP,然后git pull / git push再次工作。

來自威斯康星大學:Windows 10 TCP/IP 重置:以管理員身份打開 Windows 上的cmd提示符並按此順序運行以下命令以解決連接問題:

netsh winsock reset
netsh int ip reset
ipconfig /release
ipconfig /renew
ipconfig /flushdns

最后,重新啟動計算機。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM