1. 直接修改 .git/config 文件

注意: 仅对当前仓库有效, 推荐这种, 因为不是所有的仓库都需要走代理

[http "https://github.com"]
proxy = http://127.0.0.1:1080

或者如下

[http]
proxy = http://127.0.0.1:1080

2. 命令配置

原文: https://zhuanlan.zhihu.com/p/481574024

全局设置(不推荐)

#使用http代理

git config --global http.proxy http://127.0.0.1:1080
git config --global https.proxy https://127.0.0.1:1080 #使用socks5代理
git config --global http.proxy socks5://127.0.0.1:1080
git config --global https.proxy socks5://127.0.0.1:1080

只对Github代理(推荐)

#使用socks5代理(推荐)
git config --global http.https://github.com.proxy socks5://127.0.0.1:1080 #使用http代理(不推荐)
git config --global http.https://github.com.proxy http://127.0.0.1:1080

取消代理

当你不需要使用代理时,可以取消之前设置的代理。

git config --global --unset http.proxy git config --global --unset https.proxy

最新文章

  1. Unity3D中可中途释放的单例
  2. 求SQL语句递归的算法
  3. Android 解析JSON格式数据
  4. 使用 readfile() 下载文件
  5. linux 笔试题
  6. bdyyservice.exe 系统错误
  7. ALV可输入状态下输入金额字段变小数的问题
  8. Spring安全资料整理列表
  9. 此方法显式使用的 CAS 策略已被 .NET Framework 弃用
  10. 关于tableView的简单实例
  11. 迷宫城堡(强联通targin)
  12. ubuntu下的词典的安装
  13. ASP.NET MVC---自定义HtmlHelper方法
  14. 0_Simple__matrixMul + 0_Simple__matrixMul_nvrtc
  15. 持久化和公平分发.py
  16. Kali Linux渗透测试实战 2.2 操作系统指纹识别
  17. 20155204《网络对抗》Exp9 Web安全基础实践
  18. Word Embedding与Word2Vec
  19. Blocks POJ - 1390 多维dp
  20. Integral transform 积分变换

热门文章

  1. MFC中的RTTI(Runtime Type Identification, 运行时类型识别)详解(参考《深入浅出MFC》)
  2. JZOJ 3184. 【GDOI2013模拟7】最大异或和
  3. SQL语句中 left join 后用 on 还是 where,区别大了!
  4. 益赛普等TNFi持续治疗强直性脊柱炎的长期疗效观察(≥3年)
  5. 使用 FPM 将源码包转化为rpm包(技巧)
  6. gateway添加跨域配置
  7. mysql 主次数据库搭建
  8. 重写父类的ToString
  9. (pymssql._pymssql.OperationalError) (8152, b'String or binary data would be truncated.DB-Lib error message 20 018, severity 16:\nGeneral SQL Server error: Check messages from the SQL Server\n')
  10. .NetCore2.0引用DLL报System.InvalidOperationException: Can not find compilation library location for package 'XXX'