git-proxy - Git : 代理設置

浏览:69日期:2023-10-30

问题描述

大伙好,我在Git里面已经配置:git config --global http.proxy http://proxyuser:proxypwd@proxy.server.com:8080

eg:git config --global http.proxy http://aa:111@172.1.2.5:8080

但是當我克隆的時候,還是報錯:git clone https://github.com/plusjade/jekyll-bootstrap.git aaa

git-proxy - Git : 代理設置

请问我还需要设置什么吗?新手,研究了会,这块没弄好,谢谢。

问题解答

回答1:

我也是深受公司代理上网其害啊,好多请求都要走代理,shit。建议你用全局 代理。省去了 一些设置代理的麻烦

window 下推荐 Proxifier linux下 Proxy Chains

回答2:

写了一个smart_switcher,可以自动判别并设置各种代理,特别适合office有代理、家里无代理各种切换的情况。原理是根据《如何为 Git 设置代理?》来的,不过简化到超简单,只需设置你的网关IP和Port即可。ReadMe在此。。。

smart_switcher

A auto-detect proxy switcher fot http, https, ftp, rsync, ssh, git protocols.

Overview

A smart proxy switcher wrapper, supports http, https, ftp, rsync, ssh(connect depanded), git(connect depanded) protocols. It can automatically detect your network environment and set proxy for you.

If you usually switch the network environment (maybe home with no-proxy and workplace with proxy), it may help you a lot.

Tested in zsh and bash.

Screenshot

相关文章: