【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 命令

相关推荐
夜瞬14 小时前
Git工作流程与常用指令——从本地开发到远程协作
大数据·git·elasticsearch
FEF前端团队14 小时前
开发知识库 #01:Git 全面操作教程
git·github
weixin_5316518118 小时前
Git 操作指南
大数据·git·elasticsearch
PinTrust SSL证书20 小时前
Sectigo(Comodo)域名型DV通配符SSL
网络·网络协议·http·网络安全·https·软件工程·ssl
一个程序猿老马20 小时前
003、Git核心概念:仓库、工作区、暂存区、版本库
大数据·git·elasticsearch
披着羊皮不是狼21 小时前
Git完整学习总结
git·学习·elasticsearch
DevilSeagull21 小时前
MySQL(1) 安装与配置
java·数据库·git·mysql·http·开源·github
一个程序猿老马21 小时前
005、Git三板斧(1):git add - 将文件纳入版本管理
大数据·git·elasticsearch
Cyber4K21 小时前
【DevOps专项】Git 部署及使用方法
运维·git·devops
无限进步_1 天前
二叉树的前序遍历(非递归实现)
开发语言·数据结构·c++·windows·git·visual studio