Git设置代理服务器

方式一

  • 如果说使用的是项目http或者https地址,就配置http与https代理即可,输入以下命令:
shell 复制代码
git config --global http.proxy "socks5://127.0.0.1:1080"
git config --global https.proxy "socks5://127.0.0.1:1080"

这样使用git clone/push/pull所有http或者https地址项目都会走代理。

  • 还可以使用下面命令取消代理设置:
shell 复制代码
git config --global --unset http.proxy
git config --global --unset https.proxy

方式二

  • 在.git中的config文件中增加
shell 复制代码
[http]
    proxy = http://127.0.0.1:1080
[https]
    proxy = http://127.0.0.1:1080
相关推荐
LXY_BUAA35 分钟前
Git_在飞牛中部署 GitLab_20260817
git·gitlab
阳墨余3 小时前
Git 同时管理 Gitee 和 GitHub 的 SSH 配置实战
git·gitee·github
fengyehongWorld11 小时前
Git 认证凭据管理
git
暮云星影19 小时前
git版本发布
git·gitee·github·gitea
乌夷19 小时前
Git Flow 分支模型
git
独隅20 小时前
VS Code Git 工作树多分支并行开发实战评测
git
暮云星影1 天前
git仓库分支管理
git·gitee·github·gitea
互联网中的一颗神经元2 天前
ZZ — Git 速查表
大数据·git·elasticsearch
早安试言2 天前
git使用
git
燐妤2 天前
梦绘片场 ProjectDream故事总纲场景剧本篇:从项目到成片的 AI 漫剧工作台
人工智能·git·ai·项目开发