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
相关推荐
2301_809815259 小时前
Git和Gitee基本使用教程
git·gitee
雨翼轻尘9 小时前
01_Git概述及基本操作
git·概述·基本操作
程序员果子12 小时前
CrewAI :当 Agent 学会团队协作
人工智能·git·python·多智能体·agent框架
‎ദ്ദിᵔ.˛.ᵔ₎12 小时前
Git GDB/CGDB调试器
git·gdb
他们都叫我GPT侠14 小时前
【无标题】
git·github
果汁华14 小时前
CLI 命令行与 Python 框架实战
git·python·github
zzzzzz31015 小时前
我用 AI Agent 重构了日常开发工作流,效果出乎意料
人工智能·git·github
我叫黑大帅1 天前
git 的 NFD 与 NFC 有什么区别?为什么我有个文件在 NFC 中间不会被当成改动,在 NFD 中就会当成改动
git·面试·github
呆萌很1 天前
Git push 408 超时、远程断开解决办法
git
Lesile1 天前
Hands-on Git experience
git