git-无法解析代理:
在工作中我有代理人,在家里我没有代理人 在工作中,我将代理设置为:git-无法解析代理:,git,proxy,Git,Proxy,在工作中我有代理人,在家里我没有代理人 在工作中,我将代理设置为: git config - -global http.proxy http://proxy.theaddress.co.uk:8080 git config - -global https.proxy https://proxy.theaddress.co.uk:8080 在家里,我移除代理,就像 git config --global --unset http.proxy git con
git config - -global http.proxy http://proxy.theaddress.co.uk:8080
git config - -global https.proxy https://proxy.theaddress.co.uk:8080
在家里,我移除代理,就像
git config --global --unset http.proxy
git config --global --unset https.proxy
我正试着把一些东西推到我的git回购协议上
git push -u origin master
我得到
Could not resolve proxy: proxy.theaddress.co.uk
.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]
如何删除代理?使用以下选项检查环境变量:
$echo $http_proxy
$echo $https_proxy
$echo $HTTPS_PROXY
$echo $HTTP_PROXY
如果设置了这些环境变量中的任何一个,则只需使用http\u proxy=
即可取消设置,然后enter
将取消设置这些环境变量
$export http_proxy=
- 如果设置了以下变量,则在没有代理的网络上工作时只需删除所有变量(例如@home)
- 取消设置git代理
git config --global --unset http.proxy git config --global --unset https.proxy
cat~/.bash_配置文件
)。
我的在另一个程序的安装过程中设置了:
export HTTP_PROXY=http://proxy.somewhere.com:80
export HTTPS_PROXY=http://proxy.somewhere.com:80
将该文件移到一旁(例如,mv~/.bash\u profile~/.bash\u profile-hide
)。
然后启动一个新的终端窗口(将重新加载环境变量)。如果不启动新的终端窗口,任何现有窗口仍将设置变量,需要手动清除。此问题的解决方案是删除git代理
- 通过管理员打开终端
- 然后点击command
git config--global-l
- 然后通过下面的命令取消设置所有HTTP和https代理
&git config--global--unset所有http.proxy
git config--global--unset所有https.proxy
- 现在,您可以使用相同的命令
git config--global-l
export HTTP_PROXY=http://proxy.somewhere.com:80
export HTTPS_PROXY=http://proxy.somewhere.com:80