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. SpringBoot 源码解析 (五)----- Spring Boot的核心能力 - 自动配置源码解析

    在上一篇博客中分析了springBoot启动流程,大体的轮廓只是冰山一角.今天就来看一下springBoot的亮点功能:自动化装配功能. 先从@SpringBootApplication开始.在启动流 ...

  2. Idea集成SpringBoot实现两种热部署方式(亲测有效)

    即将介绍的两种热部署方式: 1.SpringLoaded 2.DevTools 区别: SpringLoader:SpringLoader 在部署项目时使用的是热部署的方式. DevTools:Dev ...

  3. 力扣(LeetCode)买卖股票的最佳时机 个人题解

    给定一个数组,它的第 i 个元素是一支给定股票第 i 天的价格. 如果你最多只允许完成一笔交易(即买入和卖出一支股票),设计一个算法来计算你所能获取的最大利润. 注意你不能在买入股票前卖出股票. 示例 ...

  4. BloomFilter在Hudi中的应用

    Bloom Filter在Hudi中的应用 介绍 Bloom Filter可以用于检索一个元素是否在一个集合中.它的优点是空间效率和查询时间都远远超过一般的算法,主要缺点是存在一定的误判率:当其判断元 ...

  5. 源码包的安装、rsync同步、inotify监测

    一.源码包的安装 1.源码包的作用:yum 使用的是rpm包,rpm包安装的不能指定安装位置 源码包可以按需选择/定制,及时修复bug ,适用于各种平台 2.大致过程:源码包——>make gc ...

  6. 百度杯 十二月 what_the_fuck

    对于这道题,我还真的想说 what_the_fuck !! 这道题拿到就只发觉一个格式化字符串漏洞,其他的就找不到了 . unsigned __int64 sub_4008C5() { char s; ...

  7. UML元素绘制方式

    UML是由视图(View).图(Diagrams).模型元素(Model elements)是和通用机制等几个部分构成. 视图:视图是对系统的抽象表示,UML共有9种不同的图类型. 模型元素:代表面向 ...

  8. 在ensp上模拟企业网络场景并Access接口加入相应VLAN

    模拟的企业网络大概描述: 公司内网是一个大的局域网,二层交换机S1放置在一楼,在一楼办公的部门有IT部和人事部:二层交换机S2放置在二楼,在二楼办公的部门有市场部和研发部.由于交换机组成的是广播网,交 ...

  9. 小白学习python第一天,Pycharm破解与用法(持续更新)

    目录 Pycharm安装与破解及汉化 Pycharm安装 Pycharm破解 Pycharm汉化 Pycharm使用 添加作者.时间等信息 补充 @ Pycharm安装与破解及汉化 本人最近开始找到了 ...

  10. at、crontab、anacron的基本使用

    Linux的任务调度机制主要分为两种: 1. 执行一次:将在某个特定的时间执行的任务调度 at 2. 执行多次: crontab 3.关机后恢复尚未执行的程序 anacron. ①at at命令用于在 ...