git - 将 git 代理重置为默认配置

标签 git

我安装了 Socat 以通过 HTTP CONNECT 代理使用 Git 协议(protocol),然后我在您的 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 重置为默认代理配置,我该怎么做?

最佳答案

对我来说,我必须添加:

git config --global --unset http.proxy

基本上,您可以运行:

git config --global -l 

获取所有已定义代理的列表,然后使用“--unset”禁用它们

关于git - 将 git 代理重置为默认配置,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11265463/

相关文章:

git - 列出使用特定子模块的存储库

javascript - 在 coffeescript 项目的 git 存储库中排除 .js 文件

git - 将 Git 版本控制下的 Web 项目部署到共享主机

Git - 递归删除文件扩展名

由于 Netbeans 中的这些文件,head 与 origin/master 的 git merge 失败

git - "git submodule foreach git pull origin master"和 "git pull origin master --recurse-submodules"有什么区别

Github SSH 访问 : Permission denied (publickey)

javascript - 跨团队共享 gitignored 文件

GIT 分支 - 我们能在只有 master 的情况下生存吗?

git - 将 master 重置为之前的提交 - 如何推送