Git配置代理

HTTP/HTTPS

适用于http 协议:git clone http://***.git

bash 复制代码
vim ~/.gitconfig

[http]
        proxy = socks5://127.0.0.1:10820
        proxy = http://127.0.0.1:10821
[https]
        proxy = socks5://127.0.0.1:10820
        proxy = https://127.0.0.1:10821

SSH协议

适用于ssh 协议git clone git@***.git

bash 复制代码
vim ~/.ssh/config

Host github.com
   IdentityFile "C:\Users\hatak\.ssh\id_ed25519"
   ProxyCommand connect.exe -H 127.0.0.1:10821 %h %p
# -H后是http代理   
相关推荐
阿民不加班7 小时前
【Git】git拉取远端但是本地存在不想提交文件处理
git
Selina K8 小时前
在windows安装git
git
周杰伦fans15 小时前
如何将 Feature 分支同步到 Master 主分支:一次完整的 Git 合并实战
git
jiayi_199915 小时前
git创建new branch
git
__Witheart__15 小时前
通过交互式 Rebase 合并部分提交到远程分支的操作步骤
git
魔都吴所谓16 小时前
【Tools】Repo 工具完整使用手册
git
tianyuanwo16 小时前
跨 Gerrit 项目迁移分支并保留完整历史:一份可操作的 Git 指南
git·代码迁移
玄奕子16 小时前
VS Code 上传 GitHub 全流程(Windows 环境):HTTP 与 SSH 两种方案(含常见报错排查)
git·http·ssh·github·嵌入式开发
一只游鱼17 小时前
如何让本地的敏感配置文件不上传到git仓库
git·elasticsearch
渣渣馬1 天前
shell的if多条件
git·ssh