如何解决git@github.com: Permission denied (publickey)异常

如何解决git@github.com: Permission denied异常

一、错误信息描述

git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.

原因:

权限被拒绝(公钥)。致命错误:无法从远程存储库读取。请确保您具有正确的访问权限并且存储库存在。

二、解决办法

2.1、获取本地SSH Key

  • 先执行ssh-keygen -t rsa -C 'your-emailXXXX@example.com', 看本地是否存在ssh key
  • 若本地存在,直接执行cat ~/.ssh/id_rsa.pub 获取,执行命令后如下

2.2、将本地的SSH Key添加到github


相关推荐
Maynor在掘金6 小时前
Nano Banana 2.1 来了!21 个真实案例 + 公开提示词,这份 Awesome 合集请收好
github
miofly6 小时前
ChatGPT 账号用户可免费使用 Auto-review 双智能体审查功能
开源·github
高频因子挖掘机6 小时前
第一次补历史行情:按股票拆,还是按日期拆请求?
后端·github·api
高频因子挖掘机6 小时前
300 只股票 × 两年日 K:为什么逐只循环会变成维护灾难?
后端·github·api
Jooolin7 小时前
把 GitHub Issue 的第一轮脏活交给 AI:做一个 Issue 分诊助手
人工智能·github
驭渊的小故事7 小时前
linux 基础命令 + git 仓库创建和配置命令
linux·git
u13013010 小时前
GitHub 热榜项目:日榜(2026-10-06)
人工智能·github
miofly12 小时前
Cohere推出North 2平台,主打企业AI代理可控部署
开源·github
wflynn12 小时前
GitHub 日榜趋势速报 | 2026-10-04
开源·github
wflynn12 小时前
GitHub 今日推荐|SCSKiller:游戏着色器预编译消除卡顿
开源·c#·github·nvidia·amd·directx12