由於不可描述的原因,在某些情況下Github不可用(git push和git pull都顯示遠程服務器不可用或無權限),於是就想到上代理。
首先網上搜索一通,發現如下方法:
git config --global https.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
幾輪折騰之后,發現然並卵,繼續搜索,發現終極方法:
#在~/.ssh/路徑下創建config空文件,然后粘貼如下內容:
Host github.com
ProxyCommand connect -S 127.0.0.1:1080 %h %p
重新打開git窗口,git push和git pull都可正常使用。