背景
最近打算在ubuntu上编译webrtc代码,第一条命令就失败了,如下:
git clone https://chromium.googlesource.com/chromium/tools/depot_tools
Cloning into 'depot_tools'...
fatal: unable to access 'https://chromium.googlesource.com/chromium/tools/depot_tools/': Failed to connect to chromium.googlesource.com port 443: Timed out
备受打击,多方查探,原来是可以通过设备git代理来解决的,前提条件是需要先有VPN
查看代理地址
局域网共享开启,可以给同一个局域网的别的电脑共享代理
设置git代理
git config --global http.proxy socks5://127.0.0.1:21881 #本机的话,ip就填127.0.0.1,非本机就设置成VPN主机的ip
git config --global https.proxy socks5://127.0.0.1:21881
取消代理
git config --global --unset http.proxy
git config --global --unset https.proxy
设置代理后,再次git就ok了