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
相关推荐
透明的玻璃杯2 小时前
git应用
git
炸炸鱼.4 小时前
Git+Jenkins实战(一):从零搭建自动化发布与回滚系统(附完整代码)
git·jenkins
言6666 小时前
要忽略前端依赖包node_modules的文件在目录下 git暂存区消失
git
胡小禾7 小时前
Git Worktree
git
程序员小羊!7 小时前
18 GIt
git
怣疯knight7 小时前
Git 本地分支关联远程分支 常用命令汇总
git
ANNENBERG8 小时前
git分支开发管理
git
坤坤藤椒牛肉面8 小时前
GIT的使用
git
w3296362718 小时前
使用 OpenCode 在 Windows 上加速安装 Playwright 的完整指南
windows·git
我家媳妇儿萌哒哒1 天前
git:无法推送refs到远端。您可以试着运行“拉取”功能,整合您的更改。
git