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
相关推荐
大卫小东(Sheldon)13 小时前
GIM 2.0 发布:真正让 AI 提交消息可定制、可控、可项目级优化
git·rust·gim
知识即是力量ol16 小时前
研发实战:Git 规范化开发全流程指南
git·gitee·github
我是一只代码狗16 小时前
idea创建分支
git
知识即是力量ol18 小时前
Git 快速入门 (实习生视角)
git·gitee·github
Dontla19 小时前
Git撤销上一次提交(撤销提交,Git回退提交)git reset、git revert
git
wdfk_prog19 小时前
解决 `git cherry-pick` 引入大量新文件的问题
大数据·git·elasticsearch
fu的博客21 小时前
Git从删库到跑路
git·gitee·github
要加油哦~21 小时前
git 报错 | husky - pre-commit hook exited with code 1 解决
git
知识即是力量ol1 天前
Git 实战指南:从分支管理到冲突解决
git·github·源代码管理
weixin_462446231 天前
Git 本地忽略 application-dev.yml 的最佳实践:不提交 .gitignore,不影响团队协作!
git