Git配置代理需要分两种情况:使用ssh仓库地址和使用https仓库地址,对于前者实际进行通信的软件为ssh,所以与git软件的配置无关。
一,如果仓库地址是ssh的,那么要编辑ssh配置文件。对于Linux,此文件的地址为:~/.ssh/config,对于Windows,此文件则位于:C:\Users\用户名\.ssh\config,若不存在请自行创建。并进行如下的编辑:
Host github.com *.github.com
User git
Port 22
# http使用-H,socks使用-S
ProxyCommand "D:\Development\PortableGit\mingw64\bin\connect" -S 127.0.0.1:10808 %h %p
