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
相关推荐
NaCl鱼呜啦啦14 小时前
Git 仓库损坏修复指南:从诊断到恢复
git
huazi9915 小时前
AI编程(一):Trae+Git 应用开发
git·ai编程·trae
badhope18 小时前
GitHub热门AI技能Top20实战指南
前端·javascript·人工智能·git·python·github·电脑
m0_6356474819 小时前
git管理github上的repository(三)
git·github
圥忈&&丅佽&&扗虖20 小时前
ubuntu 安装git
linux·git·ubuntu
好运yoo21 小时前
git fetch和git pull的区别
大数据·git·elasticsearch
薛不痒21 小时前
github基础入门(3):版本控制(提交,分支删除,提交规范)
大数据·windows·git·elasticsearch·github
摇滚侠1 天前
git 把已经推送到远程仓库的文件取消被 git 管理
git
007张三丰1 天前
掌握核心!Git最常用的15个命令行:从入门到实战详解
git·gitlab·github·git命令行·常用命令行
月光下的麦克2 天前
Git 打 Tag 的作用
git