簡體   English   中英

git lfs 在代理后面工作嗎?

[英]Does git lfs work behind a proxy?

我失敗的嘗試:

``

$ git push origin master
批處理響應:Post proxyconnect tcp:tls:收到長度為 20527 的超大記錄

只需在 git configs 中設置代理,git-lfs 就會識別這些設置。

看看這個問題: https : //github.com/git-lfs/git-lfs/issues/1125檢查這個關於如何設置git代理的答案https://stackoverflow.com/a/19213999

Git LFS將在〜/ .gitconfig中的設置上使用環境變量HTTPS_PROXY

確保正確設置了HTTPS_PROXY。 HTTPS_PROXY需要http網址。

例如:

HTTPS_PROXY = http://代理:8080 https_proxy = http://代理:8080

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

問題是https_proxy具有 curl 的優先級(在 git lfs 中用於通過 https:// git lfs repo 訪問)所以在 ~/.gitconfig 或您的本地配置中的所有內容都不會在https_proxy變量設置。

https_proxy可以使用 ~/.gitconfig 中的 http.proxy

請參閱下面的示例。 查看報告使用的代理的錯誤(當然它們都不起作用,但我們需要它來實現在執行 LFS 文件的 git push 時使用的優​​先級)

~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>

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM