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
相关推荐
Robot_Nav13 小时前
Git 项目维护命令指南相关讲解
git·机器人·github
i建模13 小时前
强制同步远程git仓库
git
鸿蒙程序媛16 小时前
【工具汇总】git 常用命令行汇总
大数据·git·elasticsearch
虞十三18 小时前
AtomGit 开源入门全攻略:环境搭建 + Git/Docker 实操 + 新手避坑(全平台版)
git·docker·容器
__Witheart__19 小时前
Gitblit 后台删除账户 添加权限
git
回家路上绕了弯19 小时前
IDEA 2026.1 玩转 Git Worktree:可视化操作,告别分支切换内耗
git·后端
wwj888wwj19 小时前
Ansible基础(复习3)
linux·运维·服务器·git·ansible
Slow菜鸟20 小时前
Git Worktree 使用教程
大数据·git·elasticsearch
SunnyRivers20 小时前
10分钟掌握git规范操作流程
git·规范
阿民不加班1 天前
【Git】git拉取远端但是本地存在不想提交文件处理
git