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`
相关推荐
ruanCat22 分钟前
前端工程化工具链从零配置:simple-git-hooks + lint-staged + commitlint
前端·git·代码规范
木子小喵2 小时前
Git的使用介绍!超通俗!
git
coderYYY2 小时前
git push报错Authentication failed for ‘xxx’也不会弹要求输入用户名密码的最终解决方法
前端·git·gitee·github
@PHARAOH2 小时前
WHAT - git worktree 开发的并发模型
大数据·git·elasticsearch
苦瓜小生4 小时前
【Git】| 将拉下来的代码上传到自己的 Gitee 仓库(手把手教学)
git·gitee
WKP94184 小时前
git的merge和rebase操作
git
___波子 Pro Max.7 小时前
Git 分支切换
git
win x7 小时前
一篇搞懂Git基础操作
linux·git
一个有温度的技术博主8 小时前
网安实验系列五:.git源代码泄露
git
吴声子夜歌8 小时前
TypeScript——索引类型、映射对象类型、条件类型
git·ubuntu·typescript