-
-
Save CraKeyBoy/11da7183c62d47cc0721d60e871f8dbc to your computer and use it in GitHub Desktop.
Revisions
-
chuyik revised this gist
Jun 11, 2017 . 1 changed file with 5 additions and 5 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,11 +1,11 @@ ## 分辨需要设置的代理 - HTTP 形式: > git clone https://github.com/owner/git.git - SSH 形式: > git clone [email protected]:owner/git.git ## 一、HTTP 形式 ### 走 HTTP 代理 ```bash @@ -27,7 +27,7 @@ git config --global --unset http.proxy git config --global --unset https.proxy ``` ## 二、SSH 形式 修改 `~/.ssh/config` 文件(不存在则新建): -
chuyik revised this gist
Jun 11, 2017 . 1 changed file with 19 additions and 14 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,31 +1,36 @@ ## 分辨 git clone 需要设置的代理 - HTTP 形式: https://github.com/owner/git.git - SSH 形式: [email protected]:owner/git.git ## HTTP 形式 ### 走 HTTP 代理 ```bash git config --global http.proxy "http://127.0.0.1:8080" git config --global https.proxy "http://127.0.0.1:8080" ``` ### 走 socks5 代理(如 Shadowsocks) ```bash git config --global http.proxy "socks5://127.0.0.1:1080" git config --global https.proxy "socks5://127.0.0.1:1080" ``` ### 取消设置 ```bash git config --global --unset http.proxy git config --global --unset https.proxy ``` ## SSH 形式 修改 `~/.ssh/config` 文件(不存在则新建): ``` # 必须是 github.com Host github.com -
chuyik created this gist
Jun 11, 2017 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ # 分辨 git clone 需要设置的代理 HTTP 形式: https://github.com/owner/git.git SSH 形式: [email protected]:owner/git.git # HTTP 形式 ## 走 HTTP 代理 ``` git config --global http.proxy "http://127.0.0.1:8080" git config --global https.proxy "http://127.0.0.1:8080" ``` ## 走 socks5 代理(如 Shadowsocks) ``` 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 形式 修改 `~/.ssh/config` 文件(不存在则新建): ``` # 必须是 github.com Host github.com HostName github.com User git # 走 HTTP 代理 # ProxyCommand socat - PROXY:127.0.0.1:%h:%p,proxyport=8080 # 走 socks5 代理(如 Shadowsocks) # ProxyCommand nc -v -x 127.0.0.1:1080 %h %p ```