最佳答案
我通过 HTTP CONNECT 代理安装了 Socat 来使用 Git 协议,然后在 bin 目录中创建了一个名为 gitproxy
的脚本。
#!/bin/sh
# Use socat to proxy git through an HTTP CONNECT firewall.
# Useful if you are trying to clone git:// from inside a company.
# Requires that the proxy allows CONNECT to port 9418.
#
# Save this file as gitproxy somewhere in your path (e.g., ~/bin) and then run
# chmod +x gitproxy
# git config --global core.gitproxy gitproxy
#
# More details at https://www.emilsit.net/blog/archives/how-to-use-the-git-protocol-through-a-http-connect-proxy/
# Configuration. Common proxy ports are 3128, 8123, 8000.
_proxy=proxy.yourcompany.com
_proxyport=3128
exec socat STDIO PROXY:$_proxy:$1:$2,proxyport=$_proxyport
然后我配置 git 来使用它:
$ git config --global core.gitproxy gitproxy
现在我想将 git 重置为默认的代理配置,我该如何做呢?