【git ssl error check process】

查看git 配置:git config --list

禁用ssl:git config --global http.sslVerify false

将 GitHub 仓库地址从 HTTPS 改为 SSH,可以绕过 SSL 验证问题。

git remote set-url origin git@github.com:username/repository.git

生成新的 SSH Key 推荐使用 Ed25519 算法(更安全)

ssh-keygen -t ed25519 -C "你的邮箱"

若系统不支持 Ed25519,可使用 RSA:

ssh-keygen -t rsa -b 4096 -C "你的邮箱"

一路回车即可,生成的密钥保存在 ~/.ssh/ 目录。

启动 SSH Agent 并添加私钥

eval "$(ssh-agent -s)"

ssh-add ~/.ssh/id_ed25519

复制公钥内容 macOS:

pbcopy < ~/.ssh/id_ed25519.pub

Windows (Git Bash):clip < ~/.ssh/id_ed25519.pub

Linux/win powershell:cat ~/.ssh/id_ed25519.pub

在 GitHub 添加公钥

登录 GitHub,点击右上角头像 → Settings。

左侧选择 SSH and GPG keys → New SSH key。

填写标题(如"个人笔记本"),粘贴公钥,点击 Add SSH key。

验证配置是否成功

ssh -T git@github.com

若提示 "You've successfully authenticated" 则表示成功。

git clone git@github.com:username/repo.git 可以使用git 命令

相关推荐
leoZ2317 小时前
Git 集成实战完全指南(二):智能分支管理
大数据·git·elasticsearch
qq_4523962312 小时前
第六篇:《GitLab CI 进阶:多环境部署与环境变量管理》
git·ci/cd·gitlab
有想法的py工程师13 小时前
GPG 密钥迁移指南:多私钥备份、批量导入与自动信任
git·github
浮江雾16 小时前
Flutter第五节------Flutter开发环境配置与项目创建指南
开发语言·前端·git·学习·flutter·入门·函数
aramae20 小时前
C++11:现代C++的里程碑
c语言·开发语言·c++·windows·git·后端
BerryS3N1 天前
VS Code Git 工作树:解锁多分支并行开发新体验
大数据·git·elasticsearch
工具派1 天前
从 git commit 到交付 PDF:我的一条在线工具流实录
git·elasticsearch·pdf
咋吃都不胖lyh2 天前
提交(Commit)到本地的 Git 仓库,然后才能推送(Push)到远程的 Git 仓库
git
__zRainy__2 天前
VS Code 自动同步如何重写 Git 历史:一次重复合并冲突的排查与恢复
git
IT码农-爱吃辣条2 天前
AI Codeview 安装与使用教程
git·ai