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
相关推荐
代钦塔拉8 分钟前
Git & GitHub 从入门到精通:全流程实战教程
git·github
晚风吹红霞1 小时前
Linux下的趣味编程 —— 进度条、Git版本控制与GDB调试实战
linux·运维·git
xlq223222 小时前
7.git
git
Ws_2 小时前
Git + Gerrit 第六课:commit --amend、Patch Set 与 Change-Id
git
AIMath~19 小时前
向github中上传文件过大超过50M怎么办
网络·git·github
AIMath~1 天前
如何将一个新的文件夹使用git 工具提交到github新仓库中
git·github
满天星83035771 天前
【Git】原理及使用(二) (版本回退)
linux·git
愿天垂怜1 天前
【C++脚手架】ffmpeg 库的介绍与使用
linux·服务器·开发语言·c++·ide·git·ffmpeg
月夜的风吹雨1 天前
Linux 基础开发工具详解:从 yum 到 gdb 实战指南
linux·git·ubuntu·centos·vim
好运yoo1 天前
git cherry-pick
git