2015-09-01 58 views
1

我想在在工作中使用混帳通過代理 Windows 7的。我的公司有各種代理可用。爲了避開Python pip使用的代理,我使用了Cntlm程序。使用Cntlm,我能夠指定我的域\用戶名和密碼,並使用它通過/繞過代理服務器進行連接。設置的Git代理與域

不是我想用git。我不知道哪裏把域名放在代理設置的git。下面是我遵循的CMD在Windows 7

set HTTP_PROXY=http://domain\username:[email protected]:proxyport 
git config --global http.proxy $HTTP_PROXY 
git clone git://github.com/destination.git folder 

這使超時eventhough我所有的信息是正確的,Cntlm作品相同的信息的步驟。有人可以幫助正確的程序讓git通過這樣的代理工作嗎?

回答

3

要想從https代理設置中受益,您至少應該使用https協議。

# not: 
git clone git://github.com/destination.git folder 
# but 
git clone https://github.com/destination.git folder 

注:如果環境變量設置,它將被混帳被拾起,即使混帳配置HTTP(S).proxy沒有這樣做。
你應該同時定義HTTP_PROXY和HTTP_PROXY。

你會在「Setting git to work behind NTLM-authenticated proxy: cntlm to the rescue」找到一個更完整的例子。
OP Cornel Verster提到in the comments

When using Cntlm, you should set your git http.proxy to localhost:3128 as well as you HTTP_PROXY (127.0.0.1:3128) and HTTPS_PROXY (127.0.0.1:3128) variables.

+0

謝謝,這幫助我瞭解多一點!我仍然得到錯誤:致命:無法訪問'https://github.com/scottmuc/yari.git/':未知的SSL協議錯誤連接到github.com:443? –

+0

@CornelVerster您是否設置了HTTPS_PROXY環境變量? – VonC

+0

不,我只用了git config --global http.proxy [proxy adress]。我應該設置HTTPS_PROXY環境變量嗎? –