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`
相关推荐
Molesidy1 小时前
【Git】【TortoiseGit】TortoiseGit安装与基础使用
git
lichong9519 小时前
Git 检出到HEAD 再修改提交commit 会消失解决方案
java·前端·git·python·github·大前端·大前端++
222you10 小时前
Git仓库推送到GitHub
git·github
你的人类朋友13 小时前
hotfix分支的使用
git·gitlab·github
小蜜蜂爱编程14 小时前
gerrit的部署与配置关联到不同服务器上的git仓库
运维·服务器·git·gerrit
颇有几分姿色16 小时前
Git将本地项目推送到GitLab
git·gitlab
Kent_J_Truman20 小时前
Git个人配置偏好记录以及注意事项
git
小龙报1 天前
《算法每日一题(1)--- 连续因子》
c语言·开发语言·c++·windows·git·算法·visual studio
今禾1 天前
Git完全指南(中篇):GitHub团队协作实战
前端·git·github
flow_code2 天前
切换git账户
git