松岗网站的建设,推广普通话的语文活动,seo快速推广,福州百度关键词优化Git 传输分两种协议#xff0c;SSH和 http(s)#xff0c;设置代理也需要分两种。
http(s) 代理
Command Line
使用 命令行 模式#xff0c;可以在Powershell中使用以下命令设置代理#xff1a;
$env:http_proxyhttp://127.0.0.1:7890
$env:https_proxySSH和 http(s)设置代理也需要分两种。
http(s) 代理
Command Line
使用 命令行 模式可以在Powershell中使用以下命令设置代理
$env:http_proxyhttp://127.0.0.1:7890
$env:https_proxyhttp://127.0.0.1:7890
TortoiseGit SourceTree SSH 代理
在目录 【C:\Users\[用户名]\.ssh】下添加一个 config 文件并在文件中添加以下配置
Host github.comUser gitPort 22Hostname github.comIdentityFile C:/Users/[用户名]/.ssh/id_rsaProxyCommand connect -S 127.0.0.1:7890 -a none %h %pTCPKeepAlive yes PS
虽然使用SSH但是因为Git拉取 子模块LFS时使用的是http传输所以在使用ssh克隆时如果仓库中有子模块或者LFS也需要同时设置http代理。