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
相关推荐
岱宗夫up2 小时前
.env 文件是干啥的?为什么不能提交到 Git?
大数据·git·elasticsearch·搜索引擎·gitee·github·gitcode
家里有只小肥猫15 小时前
git回退某条/多条提交记录
git
何中应17 小时前
IDEA 中让 Git 忽略 .idea 目录
java·git·intellij-idea
小柯博客20 小时前
从零开始打造 OpenSTLinux 6.6 Yocto 系统 - STM32MP2(基于STM32CubeMX)(六)
c语言·git·stm32·单片机·嵌入式硬件·开源·yocto
静若繁花_jingjing21 小时前
Git分支命令
git
stu_kk1 天前
Git常用操作指令
git
顾默@1 天前
关于git推送到远程仓库的一些操作
git
___波子 Pro Max.1 天前
Git 2.23新增命令switch使用指南
git
℘团子এ1 天前
git中,项目怎么更换远程仓库连接地址
git
言之。2 天前
Git Hooks
git