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
相关推荐
深海鱼在掘金3 小时前
Git 完全指南 —— 第1章:Git 概览与版本控制演进
git
noravinsc1 天前
关于Git Flow
git
蜜獾云1 天前
在Git中配置用户名和密码
git
scx_link1 天前
通过git bash在本地创建分支,并推送到远程仓库中
开发语言·git·bash
南大白1 天前
IntelliJ IDEA 运行时的 JVM 本地内存溢出崩溃
git
码农小旋风1 天前
Claude Code 基础用法大全:对话、分析、修改、测试、Git 和工作流
人工智能·git·chatgpt·claude
南大白1 天前
Git 撤回提交完整方案
git
像风一样的男人@1 天前
python --实现代理服务器
git·ui
sbjdhjd1 天前
从零搭建企业级 CI/CD(下):Jenkins+GitLab+Harbor 全链路实战指南
git·servlet·ci/cd·云原生·云计算·gitlab·jenkins
码云数智-大飞1 天前
Go Channel 详解:并发通信的正确姿势
前端·数据库·git