当前位置:   article > 正文

git代理设置与取消_取消 git config --global url

取消 git config --global url

0x00 前言
国外的git代码下载速度很慢,怎么办?
google的代码无法下载怎么办?
解决方法简单暴力,前提就是手里要有一个国外的代理,可以翻墙下载东西。

0x01 设置HTTP代理
设置全局代理模式,这里只设置了http,下载aosp项目足够用了,至于https代理没有研究

git config --global http.proxy http://127.0.0.1:8080
1
设置完后,在 ~/.gitconfig 这个文件中会找到对应配置

[http]
        proxy = http://127.0.0.1:8080
1
2
不使用命令的话,直接创建并修改这个文件也可以。

0x02 取消代理
git config --global --unset http.proxy
1
0x03 HTTPS设置与取消
跟HTTP代理是一样的,只不过config对于的key是https.proxy

#设置https代理
git config --global https.proxy http://127.0.0.1:8080
1
2
#取消https代理
git config --global --unset https.proxy
1
2
当然,如果用socks协议,只需要把http://或者https://替换为socks5://即可

0x04 参考文献
https://stackoverflow.com/questions/128035/how-do-i-pull-from-a-git-repository-through-an-http-proxy
 

声明:本文内容由网友自发贡献,转载请注明出处:【wpsshop博客】
推荐阅读
相关标签
  

闽ICP备14008679号