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:// ...
随机推荐
- PowerMock学习之PoweMock的入门(二)
前言 在上一篇<PowerMock学习之PoweMock的入门(一)>文章中,已经简单提及一些关于powermock的用法,但是入门还未完,我还要坚持把它学习并坚持更新到博客中. Mock ...
- CentOS7安装PPTP
CentOS7安装PPTP VPN(开启firewall防火墙) 1 准备一个CentOS7服务器 2 检查是否支持PPTP && echo ok #返回OK ...
- nyoj 457-大小写互换
457-大小写互换 内存限制:64MB 时间限制:1000ms 特判: No 通过数:18 提交数:21 难度:0 题目描述: 现在给出了一个只包含大小写字母的字符串,不含空格和换行,要求 ...
- 力扣(LeetCode)寻找数组的中心索引 个人题解
给定一个整数类型的数组 nums,请编写一个能够返回数组“中心索引”的方法. 我们是这样定义数组中心索引的:数组中心索引的左侧所有元素相加的和等于右侧所有元素相加的和. 如果数组不存在中心索引,那么我 ...
- 《JAVA 程序员面试宝典(第四版)》之循环、条件、概率
分享内容:关于集合的使用 书页号码:77页 题目:一个字符串中包含a~z中的多个字符,如有重复,如String data = "aavzcadfdsfsdhshgwasdfasd ...
- SQLite性能 - 意想不到,但又情理之中的测试结果。
win7(64) sata2 希捷 MINGW32_NT-(/) cat: /proc/cpuinfo: No such file or directory ------ in disk ---- r ...
- 你真的会用JavaScript中的sort方法吗
在平时的业务开发中,数组(Array) 是我们经常用到的数据类型,那么对数组的排序也很常见,除去使用循环遍历数组的方法来排列数据,使用JS数组中原生的方法 sort 来排列(没错,比较崇尚JS原生 ...
- Android中的设计模式
一.设计模式的分类 总体来说23种设计模式分为三大类: 创建型模式,共五种:工厂方法模式.抽象工厂模式.单例模式.建造者模式.原型模式. 结构型模式,共七种:适配器模式.装饰器模式.代理模式.外观模式 ...
- Vue 幸运大转盘
转盘抽奖主要有两种,指针转动和转盘转动,个人觉得转盘转动比较好看点,指针转动看着头晕,转盘转动时指针是在转盘的中间位置,这里要用到css的transform属性和transition属性,这两个因为不 ...
- Windows之Java开发环境快速搭建
说明:Node.js非必须,通常中小公司或创业公司,基本上都要求全栈. 补充说明: 除此之外,当公司固定JDK.Maven.Idea.Git.Node.js及其相关IDE等版本时,运维人员或者Team ...