git - 无法解析代理:

ttm*_*tmt 14 git proxy

在工作中我有一个代理,在家里我没有代理

在工作中我设置代理如:

    git config - -global  http.proxy  http://proxy.theaddress.co.uk:8080
    git config - -global  https.proxy  https://proxy.theaddress.co.uk:8080
Run Code Online (Sandbox Code Playgroud)

在家里我删除了代理

    git config --global --unset http.proxy
    git config --global --unset https.proxy
Run Code Online (Sandbox Code Playgroud)

我正试着用我的git repo推送一些东西

    git push -u origin master
Run Code Online (Sandbox Code Playgroud)

我明白了

    Could not resolve proxy: proxy.theaddress.co.uk
Run Code Online (Sandbox Code Playgroud)

.gitconfig文件如下所示.

    [user]
        name = first last
        email = first.last@sitname.co.uk
    [http]
    [https]
    [push]
        default = current
    [http]
    [core]
        excludesfile = /Users/first.last/.gitignore_global
    [difftool "sourcetree"]
        cmd = opendiff \"$LOCAL\" \"$REMOTE\"
        path = 
    [mergetool "sourcetree"]
        cmd = /Applications/SourceTree.app/Contents/Resources/opendiff-w.sh \"$LOCAL\" \"$REMOTE\" -ancestor \"$BASE\" -merge \"$MERGED\"
        trustExitCode = true
    [http]
    [https]
    [http]
    [https]
    [http]
    [https]
    [http]
    [https]
    [http]
    [https]
    [filter "media"]
        clean = git media clean %f
        smudge = git media smudge %f
        required = true
    [http]
    [https]
    [https]
    [http]
    [http]
    [https]
    [http]
Run Code Online (Sandbox Code Playgroud)

如何删除代理?

小智 17

检查环境变量:

$echo $http_proxy
$echo $https_proxy
$echo $HTTPS_PROXY
$echo $HTTP_PROXY
Run Code Online (Sandbox Code Playgroud)

如果设置了这些环境变量中的任何一个,那么只需使用http_proxy=enter取消设置然后将取消设置

$export http_proxy=
Run Code Online (Sandbox Code Playgroud)


Sat*_*ati 6

这两个步骤在Windows中共同起作用.