为git(ssh)配置代理

为提高github使用git下载和上传的速度,在Ubuntu 16.04中为git(ssh)配置代理,编辑

~/.ssh/config

,如下:

Host github.com
User git
Hostname github.com
ProxyCommand nc -X 5 -x 127.0.0.1:1089 %h %p
ServerAliveInterval 30

关于使用其他协议(https/http/git协议) 的git配置代理的方法参阅如下博文:

[1] 让你的SSH通过HTTP代理或者SOCKS5代理

[2] Ubuntu让终端走代理的办法http&ssh

[3] Ubuntu 下的 Git 在 SSH 协议下使用代理

[4] [整理]为 git 和 ssh 设置 socks5 协议的代理

你可能感兴趣的:(linux学习笔记,git)