6

My failed attempt:

```

$ git push origin master
batch response: Post proxyconnect tcp: tls: oversized record received with length 20527

CraigDavid
  • 1,046
  • 1
  • 12
  • 26

3 Answers3

3

Git LFS will use your environment variable HTTPS_PROXY over the setting in ~/.gitconfig

Be sure that HTTPS_PROXY is set correctly. HTTPS_PROXY requires an http url.

For example:

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

CraigDavid
  • 1,046
  • 1
  • 12
  • 26
  • 3
    In my experience this does not work. My regular git works fine with my `https_proxy` env var, but git lfs does not. – fouronnes Mar 01 '19 at 10:36
  • It works for me, especially after I changed the protocol prefix part of HTTPS_PROXY environment variable from "https://..." into "http://.." – TingQian LI May 13 '21 at 00:57
1

Just set the proxy in git configs, and git-lfs should recognize the settings.

Take a look at this issue: https://github.com/git-lfs/git-lfs/issues/1125 Check this answer about how to set git proxy https://stackoverflow.com/a/19213999

tjysdsg
  • 656
  • 8
  • 19
0

yes, it works, if you are careful.

The problem is that https_proxy has precedence for curl (which is used in git lfs to access via https:// the git lfs repo) so everything that is in ~/.gitconfig or your local config will not be taken into account when the https_proxy variable is set.

unsetting https_proxy makes it possible to use the http.proxy from ~/.gitconfig

see below for an example. See the error that reports the proxy used (none of them is working of course, but we need that to realize the priority used when doing a git push of LFS files)

~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>
INS
  • 10,594
  • 7
  • 58
  • 89