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
相关推荐
敲敲敲-敲代码15 小时前
git安装记录
git
我是人✓15 小时前
Git入门:从零开始掌握分布式版本控制
分布式·git
Aurora_eye16 小时前
Git 笔记
笔记·git
解道Jdon17 小时前
FigCraft把Figma用Rust从零重写了一遍
ide·windows·git·svn·eclipse·github·visual studio
橙橙笔记19 小时前
QT安卓软件的制作
android·git·qt·软件
我是人✓19 小时前
Git远程协作与标签管理全攻略
git
闰土_RUNTU19 小时前
Git实用手册(持续更新)
git
Shaoshing20 小时前
ggggggggit
git
Lucky GGBond20 小时前
解决 Git 推送报错:Could not resolve host 及 DNS 劫持排查指南
git
川石课堂软件测试20 小时前
自动化测试|持续集成Git使用详解
git·python·jmeter·mysql·ci/cd·容器·kubernetes