在工作中我有一个代理,在家里我没有代理
在工作中我设置代理如:
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)
如果设置了以下变量,则在没有代理的网络上工作时只删除所有(示例@home)
//Computer=>System properties=>Advanced=>Environment Variables
http_proxy,https_proxy,HTTPS_PROXY,HTTP_PROXY
Run Code Online (Sandbox Code Playgroud)取消设置git代理
git config --global --unset http.proxy
git config --global --unset https.proxy
Run Code Online (Sandbox Code Playgroud)这两个步骤在Windows中共同起作用.