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
相关推荐
无限进步_14 小时前
【C++】重载、重写和重定义的区别详解
c语言·开发语言·c++·ide·windows·git·github
历程里程碑14 小时前
1 . Git本地操作:版本控制 跨平台协作 仓库核心
java·开发语言·数据结构·c++·git·gitee·github
华科大胡子15 小时前
Git + 云原生
git
johnny23315 小时前
Git拓展:GitButler、Gitnuro、JGit
git
王的宝库16 小时前
GitLab 常用 Git 命令新手指南
git·学习
马优晨17 小时前
git restore --source 提交id 和 git reset --hard 提交id 有什么区别
git·git reset·git restore·git回退的区别·git回退代码
小臭希17 小时前
Git(代码版本控制系统)
java·git·github
Unity粉末状在校生1 天前
Git解决fatal: Could not read from remote repository.的问题
git
少年攻城狮1 天前
Obsidian系列---【如何使用obsidian同步到git?】
git
do better myself1 天前
网站源码如何部署和加入GIT仓库的
git