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`
相关推荐
A_Lonely_Cat12 小时前
记一次 GitHub 幽灵协作者大清洗:强制重写 Git 历史与穿透 CDN 缓存实践
git·github
和你看星星2 天前
Git rerere:让重复冲突只解决一次
git
嘻嘻仙人6 天前
Ubuntu中 git上传自己的项目和二次上传一般流程
git·github
Patrick_Wilson6 天前
Squash Merge 的血缘陷阱:为什么删掉的代码又活了过来
前端·git·程序员
沉浸学习的匿名网友6 天前
什么是 .gitignore?为什么每个 Git 项目几乎都离不开它?
前端·git
深海鱼在掘金7 天前
Git 完全指南 —— 第3章:理解工作区、暂存区、版本库三个核心
git
江华森7 天前
Git 基础筑基:从原理到团队协作的全栈实战
git
JakeJiang7 天前
Git 必备命令指南:从日常高频到项目开发实战
git
叫我少年8 天前
Windows 中安装 git
git
深海鱼在掘金14 天前
Git 完全指南 —— 第1章:Git 概览与版本控制演进
git