【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
相关推荐
技术爬爬虾4 小时前
AI编程新王Codex详细攻略,一期视频精通,附免费使用方法
程序员·github
散峰而望5 小时前
基本魔法语言分支和循环 (二) (C语言)
c语言·开发语言·github·visual studio
期待のcode6 小时前
gitee与github远程仓库
gitee·github
半桔9 小时前
【IO多路转接】IO 多路复用之 select:从接口解析到服务器实战
linux·服务器·c++·github·php
Moment9 小时前
为什么 Electron 项目推荐使用 Monorepo 架构 🚀🚀🚀
前端·javascript·github
掘金安东尼9 小时前
🧭前端周刊第437期(2025年10月20日–10月26日)
前端·javascript·github
孤廖10 小时前
面试官问 Linux 编译调试?gcc 编译流程 + gdb 断点调试 + git 版本控制,连 Makefile 都标好了
linux·服务器·c++·人工智能·git·算法·github
草梅友仁21 小时前
Npm 安全更新与千星沙箱 | 2025 年第 43 周草梅周报
npm·开源·github
冷天气会感冒1 天前
关闭VSCode的GitHub Copilot功能
vscode·github·copilot
QmDeve1 天前
Android 集成与使用模糊开关按钮视图 (BlurSwitchButtonView)
android·github