2012-07-16 115 views
10

我想弄清楚這個git的東西,並在一瞬間我搞砸了http.proxy變量。現在這只是無稽之談,'asdf'推動不起作用。我不知道以前的代理設置是什麼(我甚至不知道代理服務器是什麼)。任何方式將http.proxy設置爲正確的值?Git http.proxy設置

眼下的錯誤是:「無法解析代理服務器‘ASDF’,而訪問...致命的:HTTP請求失敗

回答

24

你錯誤地添加了一個條目到你的git配置文件中。可以使用git config來操作全局和每個存儲庫配置文件。

要找出如果添加了代理進入全球或本地配置文件從控制檯運行以下命令:

git config -l --global | grep http # this will print the line if it is in the global file 
git config -l | grep http # this will print the line if it is in the repo config file 

然後無論從全球還是本地文件運行此刪除所有http.proxy項:

git config --global --unset-all http.proxy # to remove it from the global config 
git config --unset-all http.proxy # to remove it from the local repo config file 

我希望這會有所幫助。

+0

在我的情況下,我在'''〜/ .ssh/config''中設置了ProxyCommand,我必須在頂部刪除@mamapitufo提到的內容。 – 2016-06-26 13:56:42

0

的混帳配置文件是本地一個(即不推到一個遠程回購)。
所以,除非你已經制定某種地方歷史/備份機制(如Mac上的TimeMachine),你不能輕易恢復。

在Windows例如,如果你有機會到註冊表, you can look for the proxy settings there