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
相关推荐
前端啊龙10 小时前
Git vs SVN 核心区别
git·svn
CyberSecurity_zhang10 小时前
Git工作流、命令汇总
服务器·git
悟能不能悟12 小时前
常用的git命令
git
空中湖14 小时前
免费在线PUA测试工具:识别情感操控,守护情感健康
git·测试工具
程序员小续16 小时前
git rebase 和git merge使用及区别
前端·git·后端
背影疾风18 小时前
Git版本管理系列:(一)使用Git管理单分支
大数据·开发语言·c++·git·学习·elasticsearch
彷徨而立18 小时前
【Git】git revert 或 git stash 或 git restore 都无法正常恢复库文件
git
HelloDam20 小时前
Git 小白入门教程
git
老攀呀20 小时前
Git 仓库在内网与 Gitee 间迁移及同步记录
git·gitee
慈云数据1 天前
构建自己的私有 Git 服务器:基于 Gitea 的轻量化部署实战指南
服务器·git·gitea