git配置proxy

复制代码
git config  --list
git config --global --list

配置proxy

两种proxy方式

http/https形式:git clone https://github.com/xxxxx

走ssh 形式:git clone git@github.com:xxxxx

走http/https
复制代码
git config --global http.proxy "http://127.0.0.1:7890"
git config --global https.proxy "http://127.0.0.1:7890"
取消proxy
复制代码
`git config --global --unset http.proxy
git config --global --unset https.proxy`
走ssh

修改 .ssh/config 文件(不存在则新建,Windows 一般在 C:\Users\YourName.ssh)文件夹下面新建一个文件 config,注意没有任何后缀名,就叫 config):

复制代码
`# 必须是 github.com
Host github.com
   HostName github.com
   User git
   # 走 HTTP 代理
   ProxyCommand connect - PROXY:127.0.0.1:7890 %h %p`
相关推荐
胡小禾11 分钟前
多账号下git自动切号
git
zhensherlock21 分钟前
Protocol Launcher 系列:Working Copy 提交与同步全攻略
javascript·git·typescript·node.js·自动化·github·js
前端若水30 分钟前
Git 全命令超级详细指南
大数据·git·elasticsearch
SiYuanFeng12 小时前
新手学Git:如何把本地 Git 项目上传到 GitHub
git·github
前端若水14 小时前
git回退并合并分支操作
git
程序员鱼皮19 小时前
Git WorkTree 是什么?凭什么能让 AI 编程效率翻倍?
git·ai·程序员·编程·ai编程
懵逼的小黑子21 小时前
git与远程仓库创建连接
git
前端若水1 天前
Git 撤销与恢复完全指南(超级详细版)
大数据·git·elasticsearch
golang学习记1 天前
Git 2.54 来了,这个新命令让我终于敢重写历史了
git·后端
其实防守也摸鱼1 天前
AWVS下载和安装保姆级教程
linux·服务器·git