【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
相关推荐
James_WangA3 小时前
我给 AOI 设备装了一个 Agent,然后发现工具注册才是最难写的
架构·github
James_WangA3 小时前
产线上跑 Agent:LLM 挂了不是 500 错误,是停线
架构·github
Hommy888 小时前
【开源剪映小助手】字幕接口
开源·github·aigc·剪映小助手·视频剪辑自动化
一袋米扛几楼9810 小时前
【Git】规范化协作:详解 GitHub 工作流中的 Issue、Branch 与 Pull Request 最佳实践
前端·git·github·issue
尘埃落定wf11 小时前
# GitHub CLI:告别繁琐的 Git 命令,让开发更高效
git·github
zh_xuan11 小时前
上传api调试工具到github
github
AIMath~13 小时前
彻底删除 GitHub 仓库中特定文件夹的完整指南
github
DogDaoDao14 小时前
【GitHub】OpenClaw:开源个人AI助手的新标杆
人工智能·深度学习·开源·大模型·github·ai编程·opeclaw
一点一木1 天前
🚀 2026 年 4 月 GitHub 十大热门项目排行榜 🔥
人工智能·github
宝桥南山1 天前
AI - 在命令行中尝试一下ACP(Agent Client Protocol)通信
microsoft·微软·github·aigc·copilot