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
相关推荐
LIO2 小时前
前端开发之Git 代码仓库管理详细教程
前端·git
大山同学3 小时前
DeepSeek-TUI:1M 上下文、递归子代理与 Git 沙箱回滚
git
HoneyMoose4 小时前
执行 git svn clone --stdlayout 命令无输出
git·svn
HoneyMoose6 小时前
把 SVN 仓库转换为 Git 需要的 2 个命令
git·svn
历程里程碑16 小时前
4 Git远程协作:从零开始,玩转仓库关联与代码同步(带实操代码讲解)
大数据·c++·git·elasticsearch·搜索引擎·gitee·github
金銀銅鐵18 小时前
[git] 浅解 git reset 命令
git·后端
zhangfeng113319 小时前
部署到服务器上 宝塔系统 使用宝塔在线编辑器 FTP 批量上传 Git 部署 打包上传 codebudyy 编程程序开发
服务器·git·编辑器
学习是种信仰19 小时前
Git工作流
git·深度学习
yuanyuan2o221 小时前
Git merge 的几种不同模式
git·github
视觉小萌新21 小时前
关于Vscode配置企业Git
git