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
相关推荐
渣渣馬6 小时前
shell的if多条件
git·ssh
zh_xuan6 小时前
Visual Studio 上传工程到github
ide·git·github·visual studio
AntoineGriezmann8 小时前
Git 学习笔记
git
无限进步_8 小时前
【C++】只出现一次的数字 II:位运算的三种解法深度解析
数据结构·c++·ide·windows·git·算法·leetcode
无限进步_10 小时前
【C++】多重继承中的虚表布局分析:D类对象为何有两个虚表?
开发语言·c++·ide·windows·git·算法·visual studio
回家路上绕了弯11 小时前
Git worktree 终极指南:告别分支切换烦恼,实现多分支并行开发
git·后端
日更嵌入式的打工仔12 小时前
Git & TortoiseGit
git
会的越多不会的也就越多13 小时前
Win11 右键菜单优化指南:如何把 Git 功能“提”到一级菜单?
git
rebekk15 小时前
claude工作区与git仓库的关系
linux·git·python
神の愛15 小时前
GIT,可以参数这篇,需要加以理解,文字比较冗余,还请见谅
git