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
相关推荐
减瓦7 小时前
Windows 环境使用 Git Bash 最佳实践
windows·git
史呆芬7 小时前
CodeX多仓库提交Skill搭建
git·后端·openai
城东8 小时前
Git使用[原意要新建分支提交但是误提交到原来分支恢复办法]
git·原意要新建分支提交·但是误提交到原来分支
开发者联盟league8 小时前
git 压缩本地最近多个commit
git
赵庆明老师17 小时前
Vben精讲:04-了解VSCode中的Git
ide·git·vscode
Irissgwe1 天前
第 5 篇:Git 分支基础:branch、checkout、merge 和冲突解决
git
liberalhumblehopeful1 天前
git代码管理-分支差距过大如何进行同步
git
一只楚楚猫1 天前
一篇文章入门Git工具
git
Irissgwe1 天前
第 6 篇:Git 分支进阶:分支策略、stash、bugfix 和 feature 开发
git