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`
相关推荐
MinggeQingchun11 小时前
Git - 令牌登录
git
xhy_070714 小时前
Git 合并冲突怎么解决?用 AI 处理冲突的流程、Prompt 和 4 个易错点
人工智能·git·安全·prompt·ai编程·代码复审
Zhou14113617 小时前
Git_02_GitLab协作与CI_CD
git·ci/cd·gitlab
Zhou14113617 小时前
Git_03_GitFlow分支工作流
git
Flynt17 小时前
把 bug tracker 塞进 git 仓库,同步和冲突怎么解决?我把 git-bug 拆开实测了一遍
分布式·git·开源
louisgeek2 天前
Git submodule 子模块
git
imDwAaY2 天前
6篇文章讲清楚Git:Git 实用技巧:暂存现场、挑选提交与定位 Bug (5/6)
git·后端
imDwAaY2 天前
6篇文章讲清楚Git:Git 团队开发实践:从 Pull Request 到版本发布 (6/6)
git·后端
誰能久伴不乏2 天前
看懂 Git 团队协作全流程:分支、提交、PR、rebase 到底在干嘛
git