justin2018
V2EX  ›  分享发现

Git 加速---目前正在用的方法,个人觉得挺有效果的

By justin2018 at 2021 年 3 月 9 日 · 1823 次点击

有飞机场


终端 shell 是 zsh:

# where proxy
proxy() {
  export http_proxy="http://127.0.0.1:端口号"
  export https_proxy="http://127.0.0.1:端口号"
  export all_proxy="socks5://127.0.0.1:端口号"
  echo "HTTP Proxy on"
}

# where noproxy
noproxy() {
  unset http_proxy
  unset https_proxy
  unset all_proxy
  echo "HTTP Proxy off"
}

使用,终端输入proxy


~/.ssh/config 配置

Host github.com
    HostName github.com
    User git
    IdentityFile 密钥
    ProxyCommand nc -v -x 127.0.0.1:端口号 %h %p //这个是 socks5 的代理

chrome 插件

chrome 商店 搜索GitHub 加速 目前用的是这个


使用proxychains-ng

通过 ProxyChains-NG 实现终端下任意应用代理 - 奇妙的 Linux 世界

https://www.hi-linux.com/posts/48321.html


速度上基本上杠杆的~~

7 条回复  •  2021-03-11 09:30:44 +08:00
puzzle9
   1
puzzle9  
   2021 年 3 月 9 日
我想起来了一个神奇的网站 https://github.com.cnpmjs.org/
litchinn
   2
litchinn  
   2021 年 3 月 9 日
@puzzle9 厉害了
Dvel
   3
Dvel  
   2021 年 3 月 9 日
我直接写了
```
Host *
ProxyCommand nc -X 5 -x 127.0.0.1:xxxx %h %p
```
justin2018
   4
justin2018  
OP
   2021 年 3 月 9 日
@Dvel 666 学习了 老哥
no1xsyzy
   5
no1xsyzy  
   2021 年 3 月 10 日
@Dvel 如果你是 Host *,那么你可以把 ProxyCommand 不缩进
虽然不太确定是否有 edge case……
no1xsyzy
   6
no1xsyzy  
   2021 年 3 月 10 日
@no1xsyzy s/不缩进 /放开头 /
看了下,差异是放开头 global 不会被覆盖……
好吧,大约还是 `Host *` 好点……
chioplkijhman
   7
chioplkijhman  
   2021 年 3 月 11 日
git config --global http.proxy http://127.0.0.1:1088
git config --global https.proxy http://127.0.0.1:1088
© 2026 V2EX · 37ms · 3.9.8.5