如果是 git clone http:// 或 git clone https:// 的话直接把代理服务器加到环境变量就可以了:
如果是 git clone git:// 的话麻烦一些(可能有的 git 源不提供 http/https 的方式),需要先安装 socat,然后创建一个叫做 gitproxy 的脚本并填上合适的服务器地址、端口号等,最后配置 git 使用 gitproxy 脚本:
本文介绍如何为Git配置代理,包括通过http/https和git://方式克隆仓库的方法。对于http/https,仅需设置环境变量;对于git://,则需安装socat并创建gitproxy脚本来实现。
如果是 git clone http:// 或 git clone https:// 的话直接把代理服务器加到环境变量就可以了:
如果是 git clone git:// 的话麻烦一些(可能有的 git 源不提供 http/https 的方式),需要先安装 socat,然后创建一个叫做 gitproxy 的脚本并填上合适的服务器地址、端口号等,最后配置 git 使用 gitproxy 脚本:
893
1080
2万+