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
相关推荐
阿民不加班8 小时前
【Git】git拉取远端但是本地存在不想提交文件处理
git
Selina K9 小时前
在windows安装git
git
周杰伦fans15 小时前
如何将 Feature 分支同步到 Master 主分支:一次完整的 Git 合并实战
git
jiayi_199915 小时前
git创建new branch
git
__Witheart__16 小时前
通过交互式 Rebase 合并部分提交到远程分支的操作步骤
git
魔都吴所谓17 小时前
【Tools】Repo 工具完整使用手册
git
tianyuanwo17 小时前
跨 Gerrit 项目迁移分支并保留完整历史:一份可操作的 Git 指南
git·代码迁移
玄奕子17 小时前
VS Code 上传 GitHub 全流程(Windows 环境):HTTP 与 SSH 两种方案(含常见报错排查)
git·http·ssh·github·嵌入式开发
一只游鱼17 小时前
如何让本地的敏感配置文件不上传到git仓库
git·elasticsearch
渣渣馬1 天前
shell的if多条件
git·ssh