Tan*_*yas 8 git git-for-windows
当我输入: git push origin master
错误 :
fatal: unable to access 'https://github.com/rashmitashenoy/slot9io.git/': getaddrinfo() thread failed to start
Run Code Online (Sandbox Code Playgroud)
我该怎么办?
小智 13
我遇到了同样的问题,我尝试了几种解决方案,直到我发现在我的情况下是防火墙的问题。我的是“免费防火墙”,我注意到即使授权软件和连接,仍然无法连接到远程存储库。我禁用了它并没有解决,只有卸载它后问题才解决并且我可以正常使用Git。
我的机器上有同样的问题(git 版本 2.28.0.windows.1)。该问题似乎与 HTTP 请求的 DNS 解析有关:
这是我原来的远程网址:
git remote set-url origin http://<FQDN>:<http_port>/<repository>.git
Run Code Online (Sandbox Code Playgroud)
与问题中的结果相同:
$ git pull
fatal: unable to access 'http://<FQDN>:<http_port>/<repository>.git/': getaddrinfo() thread failed to start
Run Code Online (Sandbox Code Playgroud)
将 URL 更改为已解析的 IP 时:
$ ahost <FQDN>
<FQDN> <IP>
$ git remote set-url origin http://<IP>:<http_port>/<repository>.git
Run Code Online (Sandbox Code Playgroud)
Git 连接没有问题:
$ git pull
Already up to date.
Run Code Online (Sandbox Code Playgroud)
此外,当使用 SSH 而不是 HTTP 时,解析不会出现问题:
$ git remote set-url origin ssh://<username>@<FQDN>:<ssh_port>/<repository>.git
$ git pull
Already up to date.
Run Code Online (Sandbox Code Playgroud)
Curl 在我的 MINGW64 环境中也不起作用:
$ ahost www.google.com
www.google.com 172.217.2.100
$ adig www.google.com
id: 64322
flags: qr rd ra
opcode: QUERY
rcode: NOERROR
Questions:
www.google.com . A
Answers:
www.google.com . 49 A 172.217.2.100
NS records:
Additional records:
$ curl www.google.com -v
* getaddrinfo() thread failed to start
* Couldn't resolve host 'www.google.com'
* Closing connection 0
curl: (6) getaddrinfo() thread failed to start
Run Code Online (Sandbox Code Playgroud)