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的更多相关文章

  1. git 设置和取消代理

    # 设置ss git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'soc ...

  2. Git 设置和取消代理(SOCKS5代理)

    设置代理 git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'socks ...

  3. nginx禁止非sever_name指定域名访问

    禁止非sever_name指定域名访问,将其访问指向默认站点: 设置非server_name指定域名访问,将该访问重写到test.1comserver { listen 80 default; rew ...

  4. 设置和取消git代理

    # 设置socket5代理 git config --global http.proxy 'socks5://127.0.0.1:1087' git config --global https.pro ...

  5. GitHub 设置和取消代理,加速 git clone

    git 设置代理: git config --global git 取消代理: git config --global --unset http.proxy 针对 github.com 设置代理: g ...

  6. git设置、查看、取消代理

    设置代理: git config --global http.proxy 'socks5://127.0.0.1:1080' git config --global https.proxy 'sock ...

  7. Git设置/取消代理

    设置代理 git config --global http.proxy http://proxy.com:1234 git config --global https.proxy http://pro ...

  8. git 设置代理.

    git 设置代理:(因为网络有时太慢,需要用到 ss 代理..) git config --global http.proxy http://127.0.0.1:1080 取消 代理 git conf ...

  9. git 设置ss代理

    git config --global https.proxy http://127.0.0.1:1080       git config --global https.proxy https:// ...

随机推荐

  1. Linux命令实战(四)

    1.Linux上的文件管理类命令都有哪些,其常用的使用方法及相关示例演示. 文件或目录的新建 touch :将每个文件的访问时间和修改时间修改为当前时间.若文件不存在将会创建为空文件,除非使用-c或- ...

  2. 反射与泛型--使用泛型反射API打印出给定类的所有内容

    package chapter8Demos; import java.lang.reflect.*; import java.util.Arrays; import java.util.Scanner ...

  3. hdu 1205 吃糖果 (抽屉原理<鸽笼原理>)

    吃糖果Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65535/32768 K (Java/Others)Total Submissi ...

  4. 力扣(LeetCode)移除元素 个人题解

    给定一个数组 nums 和一个值 val,你需要原地移除所有数值等于 val 的元素,返回移除后数组的新长度. 不要使用额外的数组空间,你必须在原地修改输入数组并在使用 O(1) 额外空间的条件下完成 ...

  5. 领扣(LeetCode)交替位二进制数 个人题解

    给定一个正整数,检查他是否为交替位二进制数:换句话说,就是他的二进制数相邻的两个位数永不相等. 示例 1: 输入: 5 输出: True 解释: 5的二进制数是: 101 示例 2: 输入: 7 输出 ...

  6. kafka-manager新手安装入门指南

    Kafka-manager安装教程 使用环境 ubuntu18.04 Java 8 一.下载kafka 官网下载地址如下 https://www.apache.org/dyn/closer.cgi?p ...

  7. [ch03-02] 交叉熵损失函数

    系列博客,原文在笔者所维护的github上:https://aka.ms/beginnerAI, 点击star加星不要吝啬,星越多笔者越努力. 3.2 交叉熵损失函数 交叉熵(Cross Entrop ...

  8. Linux的curl和wget

    wget wget命令用来从指定的URL下载文件.wget非常稳定,它在带宽很窄的情况下和不稳定网络中有很强的适应性,如果是由于网络的原因下载失败,wget会不断的尝试,直到整个文件下载完毕.如果是服 ...

  9. Log4net 使用汇总(网络收集整理)

    原帖1:http://blog.csdn.net/wanzhuan2010/article/details/7587780 原帖2:http://grim1980.blog.sohu.com/2555 ...

  10. Android项目依赖库管理方式简介

    在实际的android项目开发过程中,我们一般都会用一些现有的第三方库来实现我们的需求,避免重复造轮子.普遍使用到的,例如:网络请求库.图片处理库.界面UI库(自定义View.动画效果等).各种第三方 ...