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. Java基础:数组的声明,循环,赋值,拷贝。

    数组的声明 一般有两种形式的声明: int[] a; int a[]; 这两种声明都没错,但是大多数都使用第一种声明,因为变量名是独立的,不带任何符号. 声明一个数组,并没有将a真正的初始化为一个数组 ...

  2. C语言|博客作业06

    这个作业属于哪个课程 C语言程序设计II 这个作业的要求在哪里 https://edu.cnblogs.com/campus/zswxy/CST2019-1/homework/9885 我在这个课程的 ...

  3. LVM术语及相互关系

    *物理存储介质(PhysicalStorageMedia) 指系统的物理存储设备:磁盘,如:/dev/hda./dev/sda等,是存储系统最底层的存储单元. *物理卷(Physical Volume ...

  4. fiddler工具使用大全

    Fiddler基础知识 Fiddler是强大的抓包工具,它的原理是以web代理服务器的形式进行工作的,使用的代理地址是:127.0.0.1,端口默认为8888,我们也可以通过设置进行修改. 代理就是在 ...

  5. Win10专业版和企业版的区别

    微软最新的Windows 10版本诸多,包括精简版(S).家庭版(Home).专业版(Pro).企业版(Enterprise),而论功能体验,Win10专业版和企业版无疑是最完善的.那么,Win10专 ...

  6. Mac 下安装并配置 Tomcat

    1,下载 点击 官网 ,进入下载页面, 2,安装 解压出来,即安装完成. 移动解压后的文件,换个文件目录(方便集中管理),将它改个名字(毕竟名字太长了). 我将其改名为 tomcat9 ,移入资源库目 ...

  7. 在Raspberry Pi上创建容器

    树莓派Raspbian默认是支持LXC容器的,下面我们介绍一下在树莓派上创建并运行容器的过程. 1. 安装LXC相关的package $ sudo apt-get install -y git lxc ...

  8. tcp和udp的网络编程(发送消息及回复)

    一.UDP  无连接的  高效的  基于数据报的  不可靠 的连接 主要的应用场景: 需要资源少,网络情况稳定的内网,或者对于丢包不敏感的应用,比如 DHCP 就是基于 UDP 协议的.不需要一对一沟 ...

  9. Ubuntu中使用Nginx+rtmp模块搭建流媒体视频点播服务

    1. 背景 不知不觉笔者来到流媒体部门已经一年半多了,积攒了不少的流媒体知识,但平时工作也比较忙,很少进行总结性的梳理,最近准备花几个周末时间写一个流媒体系列的实践文章,也算是给自己做总结的同时帮助有 ...

  10. 【Luogu P2471】[SCOI2007]降雨量

    Luogu P2471 啊啊啊啊这真是一道史上最毒瘤的题目!!!!! 题意就是给出n个年份的降雨量 询问:"自从\(y\)年以来\(x\)年的降雨量最大"的正确性. 显然有多种情况 ...