git設置ss代理
阿新 • • 發佈:2018-07-20
ss代理 onf wrap nod word 代理 oba command https
// 查看當前代理設置
git config --global http.proxy
http/https協議
//設置代理(clone https://前綴的repo會走代理)
git config --global http.proxy ‘http://127.0.0.1:1080‘
git config --global https.proxy ‘http://127.0.0.1:1080‘
git config --global http.proxy ‘socks5://127.0.0.1:1080‘
git config --global https.proxy ‘socks5://127.0.0.1:1080‘
刪除 git config --global --unset http.proxy git config --global --unset https.proxy SSH協議
配置一個 proxy-wrapper
腳本
cat > $HOME/bin/proxy-wrapper
#!/bin/bash
nc -x 127.0.0.1:080 -X5 $*
給它增加一個可執行權限
$ chmod +x $HOME/bin/proxy-wrapper
配置 .ssh/config
, 對 github.com 設置一個代理命令
Host github github.com
Hostname github.com
User git
ProxyCommand $HOME/bin/proxy-wrapper ‘%h %p‘
必須全部走ssh協議
$ git clone [email protected]:jjrdn/node-open.git
git設置ss代理