git代理设置与取消
2023-09-11 14:22:07 时间
0x00 前言
- 国外的git代码下载速度很慢,怎么办?
- google的代码无法下载怎么办?
解决方法简单暴力,前提就是手里要有一个国外的代理,可以翻墙下载东西。
0x01 设置HTTP代理
设置全局代理模式,这里只设置了http,下载aosp项目足够用了,至于https代理没有研究
git config --global http.proxy http://127.0.0.1:8080
设置完后,在 ~/.gitconfig 这个文件中会找到对应配置
[http]
proxy = http://127.0.0.1:8080
不使用命令的话,直接创建并修改这个文件也可以。
0x02 取消代理
git config --global --unset http.proxy
0x03 HTTPS设置与取消
跟HTTP代理是一样的,只不过config对于的key是https.proxy
#设置https代理
git config --global https.proxy http://127.0.0.1:8080
#取消https代理
git config --global --unset https.proxy
当然,如果用socks协议,只需要把http://
或者https://
替换为socks5://
即可
0x04 参考文献
https://stackoverflow.com/questions/128035/how-do-i-pull-from-a-git-repository-through-an-http-proxy
相关文章
- [Git] Git fetch和git pull的区别
- git:Git fetch和git pull的区别, 解决Git报错:error: You have not concluded your merge (MERGE_HEAD exists).
- Nginx 反向代理
- [Git] A better git process
- [Git] git Ignore a File that has Already been Committed and Pushed
- [Practical Git] Compare file changes with git diff
- [Practical Git] Format commit history with git log arguments
- [Practical Git] Navigate git command pager output with Unix less commands
- Nginx反向代理的目录访问问题
- 【学习总结】Git学习-GIT工作流-千峰教育(来自B站)
- [Practical Git] Configure global settings with git config
- [Practical Git] Diagnose which commit broke something with git bisect
- [Practical Git] Clean up commits with git rebase
- [Practical Git] Filter commit history with git log arguments
- [Practical Git] Navigate git command pager output with Unix less commands
- 解决go包管理代理网址无法访问:proxy.golang.org 换成goproxy.cn
- SpringAOP编程-传统基于JDK代理的AOP开发
- 使用 http-proxy 实现 SAP UI5 请求的代理重定向
- Java代理模式:如何优雅地控制对象访问?
- Python:设计模式之代理模式
- charles手机代理设置与mock数据
- Git设置代理和取消代理的方式
- Git 报错fatal: not a git repository (or any parent up to mount point /) Stopping at filesystem bounda
- 【Git总结大全】git操作从入门到实战(总结篇)
- golang 设置环境变量 代理
- [Git & GitHub] Windows安装git和环境变量配置