git 设置和取消指定域名代理 - git config proxy

Firstly - Check
Check if U have global .gitconfig file
检查是否有全局 .gitconfig 文件
Usually global .gitconfig will be created in directory /Users/yourAccountName
通常情况下全局的.gitconfig文件会在文件夹 /Users/你的用户名下
Such as mine, it is being /Users/robingao
我的是/Users/robingao(Just because my account name of my MBP is robingao)
Secondly - Show the code
If not exist, it just indecated that you had never config global git configuration.But it happened rarely.
如果不存在,说明你从来没有配置过git的全局配置。但,这种情况极少
U can just created it by opening your terminal in spotlight(shotcut: ⌘ + space), and copy and run(just tap ↩︎ button) the code below
你可以通过聚焦搜索来打开终端(快捷键:⌘ + 空格),复制并运行(回车)下面的代码
git config --global http.https://github.com.proxy http://127.0.0.1:1080
Thirdly - Description
- U can open the .gitconfig by clicking it, and U can see the text below what was generated just now.
- 你可以打开.gitconfig文件来查看,会显示刚刚生成的如下文本
[http "https://github.com"]
proxy = http://127.0.0.1:1080
The proxy works as a medium between https://github.com and your device
代理在你的设备和https://github.com之间充当媒介
U must check if your proxy port is 1080. If not, change it into yours.
查看你的代理端口是否是1080,如果不是,改成你自己的。
Forthly
- U wanna got all connection through git mediated by your proxy, U might just code
http.proxy.Whole code is shown below - 如果你想所有的git命令都走代理,只需要写
http.proxy,完整代码如下
git config --global http.proxy http://127.0.0.1:1080
Fifthly
- It is not the end. U have to run another code below to ensure https connection go through proxy
- 还没结束。还需要再运行下面的代码,确保https的连接也走代理
git config --global https.https://github.com.proxy https://127.0.0.1:1080
OR(或者)
git config --global https.proxy https://127.0.0.1:1080
------------------------- MAGIC CODE AREA / 完整代码 -------------------------
- If U just wanna got configured right now, and have no time to understand it, just run the magic code behind
如果你就想配置完就完事了,没时间搞懂,那就直接复制运行下面的代码
git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080
OR JUST GITHUB PROXY
git config --global http.https://github.com.proxy http://127.0.0.1:1080
git config --global https.https://github.com.proxy https://127.0.0.1:1080
------------------------ SOCKS5 HERE / socks5 代理 ---------------------------------
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080
OR JUST GITHUB PROXY
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080
git config --global https.https://github.com.proxy socks5://127.0.0.1:1080
----------------------- UNSET PROXY / 重置代理 --------------------------------
git config --global --unset http.https://github.com.proxy
git config --global --unset https.https://github.com.proxy
OR
git config --global --unset http.proxy
git config --global --unset https.proxy
ANOTHER WAY
- U might open .gitconfig and type the configuration text just like
- 你也可以直接打开.gitcofig文件,直接写下文本,像这个
[http "https://github.com"]
proxy = http://127.0.0.1:1080
[https "https://github.com"]
proxy = https://127.0.0.1:1080
END
git 设置和取消指定域名代理 - git config proxy的更多相关文章
- git 设置和取消代理
# 设置ss git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'soc ...
- Git 设置和取消代理(SOCKS5代理)
设置代理 git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'socks ...
- nginx禁止非sever_name指定域名访问
禁止非sever_name指定域名访问,将其访问指向默认站点: 设置非server_name指定域名访问,将该访问重写到test.1comserver { listen 80 default; rew ...
- 设置和取消git代理
# 设置socket5代理 git config --global http.proxy 'socks5://127.0.0.1:1087' git config --global https.pro ...
- GitHub 设置和取消代理,加速 git clone
git 设置代理: git config --global git 取消代理: git config --global --unset http.proxy 针对 github.com 设置代理: g ...
- git设置、查看、取消代理
设置代理: git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'sock ...
- Git设置/取消代理
设置代理 git config --global http.proxy http://proxy.com:1234 git config --global https.proxy http://pro ...
- git 设置代理.
git 设置代理:(因为网络有时太慢,需要用到 ss 代理..) git config --global http.proxy http://127.0.0.1:1080 取消 代理 git conf ...
- git 设置ss代理
git config --global https.proxy http://127.0.0.1:1080 git config --global https.proxy https:// ...
随机推荐
- hdu 1530 Maximum Clique (最大包)
Maximum CliqueTime Limit: 20000/10000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)T ...
- 就该这样理解 OSI 七层参考模型、浅谈不同局域网之间的通信
简介 说到OSI参考模型,理解网络与网络之间的关系,不说太深入难以理解的东西,只求能最大程度上理解与使用. 参考模型是国际标准化组织(ISO)制定的一个用于计算机或通信系统间互联的标准体系,一般称为O ...
- 万恶之源-python的进化
列表 列表的增删改查 3. 列列表的嵌套 元组和元组嵌套 5. range ⼀一. 列表 1.1 列表的介绍 列表是python的基础数据类型之⼀一 ,其他编程语⾔言也有类似的数据类型. 比如JS中的 ...
- d3.js 地铁轨道交通项目实战
上一章说了如何制作一个线路图,当然上一章是手写的JSON数据,当然手写的json数据有非常多的好处,例如可以应对客户的各种BT需求,但是大多数情况下我们都是使用地铁公司现成的JSON文件,话不多说我们 ...
- Asis CTF 2016 b00ks理解
---恢复内容开始--- 最近在学习堆的off by one,其中遇到这道题,萌新的我弄了大半天才搞懂,网上的很多wp都不是特别详细,都得自己好好调试. 首先,这题目是一个常见的图书馆管理系统,虽然我 ...
- kali linux 2019.4设置为中文方法
就在前天,2019年11月26日,kali Linux官网发布了最新版本:Kali Linux 2019.4发行版,此版本和之前相比变动很大,系统界面.主题.壁纸都灿然一新. Kali Linux20 ...
- Python-beautifulsoup库
#beautifulsoup库的安装 pip install beautifulsoup4 python -m pip install --upgrage pip from bs4 import Be ...
- Linux下用Docker部署接口安全的运行环境
背景:MySQL数据库运行在宿主机上(Linux) 需求:Redis.服务.页面分别运行在独立的docker中,并处于同一网络,容器内部重要目录要挂载在物理目录,保证数据安全 方法: 一.设置网络环境 ...
- Spring Boot2 系列教程(二十八)Spring Boot 整合 Session 共享
这篇文章是松哥的原创,但是在第一次发布的时候,忘了标记原创,结果被好多号转发,导致我后来整理的时候自己没法标记原创了.写了几百篇原创技术干货了,有一两篇忘记标记原创进而造成的一点点小小损失也能接受,不 ...
- for源码实现
for源码实现 我们知道,java的while和for基本上是实现一样的功能,这样会不会有一点缺点,同时java的迭代器显得尤为的麻烦. python的for和while就不同了,在实现迭代的功能的情 ...