git lfs 是否在代理后面工作?

Does git lfs work behind a proxy?

我失败的尝试:

```

$ git 推送源主
批处理响应:Post proxyconnect tcp:tls:收到长度为 20527 的超大记录

Git LFS 将在 ~/.gitconfig

中使用你的环境变量 HTTPS_PROXY

确保 HTTPS_PROXY 设置正确。 HTTPS_PROXY 需要一个 http url.

例如:

HTTPS_PROXY=http://proxy:8080 https_proxy=http://proxy:8080

只需在 git 配置中设置代理,git-lfs 应该可以识别这些设置。

看看这个问题:https://github.com/git-lfs/git-lfs/issues/1125 检查此答案关于如何设置 git 代理

是的,如果你小心的话,它是有效的。

问题是 https_proxy 优先于 curl(在 git lfs 中用于通过 https:// git lfs 存储库访问)所以所有内容都在设置 https_proxy 变量时,~/.gitconfig 或您的本地配置将不会被考虑在内。

取消设置 https_proxy 可以使用 ~/.gitconfig

中的 http.proxy

请参阅下面的示例。查看报告使用的代理的错误(其中 none 当然可以工作,但我们需要它来实现在 git 推送 LFS 文件时使用的优​​先级)

~test>git config -l | grep http.proxy
http.proxy=git_config_proxy:1234

# set variable - ignore git config

~test>https_proxy=env_var_proxy:3128 git clone git@....../bloblfs.git
Cloning into 'bloblfs'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 11 (delta 1), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (11/11), done.
Resolving deltas: 100% (1/1), done.
Downloading .... (39 MB)
Error downloading object: ...... : 
Post "https://......./info/lfs/objects/batch": proxyconnect tcp: 
dial tcp: lookup env_var_proxy on [::1]:53: read udp [::1]:49777->[::1]:53: read: connection refused

# see above the env_var_proxy used ^
# next see the value from ~/.gitconfig (or local repo) being used
# no variable - read git config

~test>git clone git@....../bloblfs.git
Cloning into 'bloblfs'...
remote: Enumerating objects: 11, done.
remote: Counting objects: 100% (11/11), done.
remote: Compressing objects: 100% (11/11), done.
remote: Total 11 (delta 1), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (11/11), done.
Resolving deltas: 100% (1/1), done.
Downloading .... (39 MB)
Error downloading object: ..... : 
Post "https://.........../info/lfs/objects/batch": proxyconnect tcp: 
dial tcp: lookup git_config_proxy on [::1]:53: read udp [::1]:45600->[::1]:53: read: connection refused

~test>