如何用SSH克隆GitHub项目

诸神缄默不语-个人CSDN博文目录

使用场景:由于不可知的网络问题,无法用HTTPS克隆GitHub项目。

报错fatal: unable to access 'https://github.com/PolarisRisingWar/llm-throught-ages.git/': GnuTLS recv error (-110): The TLS connection was non-properly terminated.

解决方案:改用SSH克隆

步骤一:

在本地创建public key

参考资料:https://docs.github.com/en/authentication/connecting-to-github-with-ssh/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent?platform=linux

Linux系统,运行命令:ssh-keygen -t ed25519 -C "your_email@example.com"

在储存public key的位置(默认是.ssh/id_ed25519.pub)得到public key

步骤二:

在GitHub设置中新增SSH Key:https://github.com/settings/keys

随便起个名字,然后将public key输入即可

步骤三:

用SSH克隆GitHub项目

复制GitHub项目的SSH URL:

在本地运行git clone ssh_url即可

相关推荐
HelloGitHub1 小时前
这个年轻的开源项目,想让每个人都能拥有自己的专业级 AI 智能体
开源·github·agent
刘发财7 小时前
弃用html2pdf.js,这个html转pdf方案能力是它的几十倍
前端·javascript·github
sunny86515 小时前
Claude Code 跨会话上下文恢复:从 8 次纠正到 0 次的工程实践
人工智能·开源·github
ZengLiangYi20 小时前
Git Tag + Semver + CI/CD:从打标签到自动发布的完整实践
github
徐小夕1 天前
JitWord Office预览引擎:如何用Vue3+Node.js打造丝滑的PDF/Excel/PPT嵌入方案
前端·vue.js·github
程序员鱼皮1 天前
离大谱,我竟然在 VS Code 里做了个视频!
github·aigc·ai编程
碳基沙盒1 天前
OpenClaw 多 Agent 配置实战指南
运维
答案answer1 天前
一个非常实用的Three.js3D模型爆破💥和切割开源插件
前端·github·three.js