我尝试执行git pull --rebase
,但出现以下错误:
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.
我尝试做git remote -v
并且正确列出了来源。
如何修复此错误?
我最近通过从分叉上的远程地址中删除ssh
来解决此问题:
origin ssh://git@ghe.company.net:yunus/client.git (fetch)
origin ssh://git@ghe.company.net:yunus/client.git (push)
...
更新为:
origin git@ghe.company.net:yunus/client.git (fetch)
origin git@ghe.company.net:yunus/client.git (push)
...
只需将主机名添加到/etc/hosts
文件
# IP hostname
1.55.4.5.66 hostname@host.com
我遇到了同样的错误。通过切换到另一个 DNS 服务器来修复它。
你可以试试谷歌域名
- 8.8.8.8
- 8.8.4.4
从这里获得答案