设置 Git 代理

在使用 GitHub 子模块安装 HUGO 主题时会提示无法连接到仓库,网上搜索后发现原因为未设置 Git 代理。在 CMD 中使用下方命令可开启代理

GIT
git config --global http.proxy http://127.0.0.1:port
git config --global https.proxy http://127.0.0.1:port
点击展开查看更多

其中 http://127.0.0.1 为本机地址,不用更改, port 为使用代理的端口号。我这里使用的为 Clash for Windows, http 和 https 对应的端口号分别为 7890 和 7891

再次使用 Git 子模块命令安装主题,一般可正常下载

版权声明

作者: FreddieFu

链接: https://freddie-fu-git.github.io/f7d92018/

许可证: CC BY-NC-SA 4.0

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 4.0 International License. Please attribute the source, use non-commercially, and maintain the same license.

开始搜索

输入关键词搜索文章内容

↑↓
ESC
⌘K 快捷键