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:// ...
随机推荐
- CentOS安装图解(在VMware 8上安装)
近期准备学习一下CentOS,打算先在VMware上装一个用于初步了解. 整体步骤如下: 一.获取CentOS安装镜像.可以从以下几个地方获取,顺便提一句,我是从163下载的. 1.CentOS的官方 ...
- ThinkPHP 6.0 管道模式与中间件的实现分析
设计模式六大原则 开放封闭原则:一个软件实体如类.模块和函数应该对扩展开放,对修改关闭. 里氏替换原则:所有引用基类的地方必须能透明地使用其子类的对象. 依赖倒置原则:高层模块不应该依赖低层模块,二者 ...
- nyoj 115-城市平乱 (BFS)
115-城市平乱 内存限制:64MB 时间限制:1000ms 特判: No 通过数:5 提交数:8 难度:4 题目描述: 南将军统领着N个部队,这N个部队分别驻扎在N个不同的城市. 他在用这N个部队维 ...
- linux磁盘分区、格式化、挂载
新建分区的操作步骤,如下图: 1)RAID卡: 机器有没有RAID卡可以在开机时看有没有出现配置RAID什么的提示(亲测),系统运行时有没有,不知道! 服务器大多有这个新加硬盘后不修改raid,开即f ...
- Arduino驱动ILI9341彩屏(一)——颜色问题
最近在淘宝的店铺上淘到了一块ILI9341的彩色液晶屏,打算研究一下如何使用. 淘宝店铺购买屏幕之后有附源代码可供下载,代码质量惨不忍睹,各种缩进不规范就不说了,先拿来试一下吧. 这是淘宝店铺代码的核 ...
- C# UTM坐标和WGS84坐标转换小工具
工具根据:http://home.hiwaay.net/~taylorc/toolbox/geography/geoutm.html js代码改编 工具源码github:https://github. ...
- 2C 还是 2B,跟找工作有什么关系?
通常,我们会把公司的业务类型分成以下几种: 2C,to Customer,指面向个人客户的业务,即将公司的产品或服务销售给个人,通常做出购买决策的个人也是使用产品或服务的用户.举例说明,像 BAT 发 ...
- javescript 的 对象
一,定义:对象是JavaScript的一个基本数据类型,是一种复合值,它将很多值(原始值或者其他对象)聚合在一起,可通过名字(name/作为属性名)访问这些值.即属性的无序集合. 关键是name属性名 ...
- Spring与Shiro整合 登陆操作
Spring与Shiro整合 登陆操作 作者 : Stanley 罗昊 [转载请注明出处和署名,谢谢!] 编写登陆Controller方法 讲解: 首先,如果你登陆失败的时候,它会把你的异常信息丢到 ...
- 【2018寒假集训 Day2】【动态规划】挖地雷
挖地雷(Mine) 在一个地图上有N 个地窖(N<=200),每个地窖中埋有一定数量的地雷.同时,给出地窖之间的连接路径,并规定路径都是单向的,且从编号小的地窖通向编号大的地窖.某人可以从任一处 ...