【github】秘钥

问题22端口refused

bash 复制代码
(base) PS F:\0.模块\8.elrs\ExpressLRS-master\src> ssh -T git@github.com
ssh: connect to host github.com port 22: Connection refused
通过GitHub支持的443端口进行SSH连接,绕过对22端口的封锁。

这是解决22端口被阻的最常见方法。GitHub允许通过443端口进行SSH连接。

bash 复制代码
# 确保 .ssh 目录存在
mkdir -p ~/.ssh

# 创建或覆盖 config 文件并写入配置
Set-Content -Path ~/.ssh/config -Value @"
Host github.com
  Hostname ssh.github.com
  Port 443
  User git
  IdentityFile ~/.ssh/id_rsa
"@

如果你使用了网络代理,需要为 Git 命令也配置代理:

bash 复制代码
# 设置全局代理(根据你的代理软件设置修改端口)
git config --global http.proxy http://127.0.0.1:7890
git config --global https.proxy http://127.0.0.1:7890

# 完成后,可以检查配置
git config --global --get http.proxy

如果某天代理关闭了,需要取消代理设置:

bash 复制代码
git config --global --unset http.proxy
git config --global --unset https.proxy

问题

bash 复制代码
VCSBaseException: VCS: Could not process command ['git', 'clone', '--recursive', 'https://github.com/mavlink/c_library_v2.git', 'C:\\Users\\lenovo\\.platformio\\.cache\\tmp\\pkg-installing-2oegf3e_']

强制 Git 对 GitHub 使用 SSH 协议

你可以通过修改全局 Git 配置,强制所有与 GitHub 的交互都通过 SSH 进行:

bash 复制代码
git config --global url."git@github.com:".insteadOf "https://github.com/"

子模块

当你克隆仓库时,如果没有使用--recursive参数,这些子模块目录就会是空的。

复制代码
git submodule update --init --recursive

这个命令会下载并初始化所有子模块

也可以git clone时加上--recursive(递归)

复制代码
git clone --recursive https://github.com/EdgeTX/edgetx.git
相关推荐
周杰伦_Jay9 小时前
【Agent智能体】开发流程与开源框架对比(GitHub热门项目分析)
开源·github
CoderJia程序员甲9 小时前
GitHub 热榜项目 - 日榜(2025-12-14)
ai·llm·github
nvd119 小时前
GKE web 应用实现 Auth0 + GitHub OAuth 2.0登录实施指南
前端·github
永恒-龙啸10 小时前
闲置机安装istoreos+常用软件介绍
linux·github·开源软件·istoreos
Irene199110 小时前
GitHub 新建项目操作指南
github
测试人社区-小明10 小时前
医疗AI测试:构建安全可靠的合规体系
运维·人工智能·opencv·数据挖掘·机器人·自动化·github
jimy110 小时前
在一台电脑上生成多个ssh公钥并添加到不同GitHub账号
运维·ssh·github
running up17 小时前
Github 首页美化教程
github
草梅友仁1 天前
草梅 Auth 1.12.0 发布与墨梅博客立项经验 | 2025 年第 50 周草梅周报
开源·github·ai编程
雪域迷影1 天前
Windows11中使用VS2022编译运行libevent网络库
网络·github·cmake·visual studio·libevent