批处理响应:拨号 tcp:查找 gitlab.com:没有这样的主机

batch response: dial tcp: lookup gitlab.com: no such host

如果我要推送一个小型私有存储库,一切都可以

Sepideh@DESKTOP-M232FOC MINGW64 /e/Test_gitlab (master)
$ git push -u origin --all
Enumerating objects: 3, done.
Counting objects: 100% (3/3), done.
Writing objects: 100% (3/3), 236 bytes | 78.00 KiB/s, done.
Total 3 (delta 0), reused 0 (delta 0)
To gitlab.com:abadpours/test.git
 * [new branch]      master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.

Sepideh@DESKTOP-M232FOC MINGW64 /e/Test_gitlab (master)
$ git push -u origin --tags
Everything up-to-date  

但对于大型 (1.94 GB)、支持 LFS 的私有存储库,我将具有以下内容:

Sepideh@DESKTOP-M232FOC MINGW64 /e/MSc_Thesis (master)
$ git config lfs.https://gitlab.com/abadpours/msc_thesis.git/info/lfs.locksverify true

Sepideh@DESKTOP-M232FOC MINGW64 /e/MSc_Thesis (master)
$ git push -u origin --all
Connection to gitlab.com closed by remote host.
Uploading LFS objects:   0% (0/4), 62 MB | 109 KB/s, done
batch response: Post https://gitlab.com/abadpours/msc_thesis.git/info/lfs/objects/batch: dial tcp: lookup gitlab.com: no such host
error: failed to push some refs to 'git@gitlab.com:abadpours/msc_thesis.git'  

结果和昨天一样。有什么办法可以解决这个问题吗?

您正在为远程存储库使用 SSH URL:git@gitlab.com:abadpours/xxx

这意味着您不关心 HTTP 代理。

但是 Git LFS 对象正在使用 HTTPS URL,这意味着,如果您使用代理,您可能会遇到一些问题,例如 git-lfs/git-lfs issue 1424.

One is that we don't support socks5h, which is known and is a limitation in Go. The other is that we seem to prepend http:// to the proxy if it doesn't contain it, which is probably not a good idea if we want SOCKS support to work.

或:git-lfs/git-lfs issue 3551

I cannot get git lfs fetch to work behind my corporate proxy. Same error when it's configured with either the env var http_proxy or git.config http.proxy.

I looked at the proxy server logs with a sysadmin and it appears git-lfs is not even adressing the proxy, but trying to access the network directly (hence the DNS error). Regular git and other network activities work fine in this configuration.

在后一种情况下,如果是 the proxy configuration (http://username:password@host.fr:8050) which was not properly percent-encoded


作为Drew Blessing adds :

It may be a good test to try to clone the project via HTTPS in a different location.
This would rule out a general problem with connecting to GitLab.com via 443 - git clone https://gitlab.com/group/project.git.
If that doesn't work then there's definitely a problem with network, proxy, etc.

应使用

HTTPS URL 而不是 SSH URL