如何解决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


相关推荐
蓝瑟柳絮1 小时前
学习之git的团队协作
git·学习
ahauedu5 小时前
TaskingAI实践(一)快速上手
ai·github
或许命运不可揣测6 小时前
快速git
git
异构算力老群群7 小时前
如何将Git本地代码推送到Gitee云端仓库
开发语言·git·gitee
ou.cs8 小时前
Git 提取和拉取的区别在哪
git
这家伙是个好家伙9 小时前
GitHub Copilot Issue in Visual Studio Code “Status Ready (disabled)“
vscode·github·copilot·issue
取经蜗牛9 小时前
git使用的说明总结
大数据·git·elasticsearch
___波子 Pro Max.12 小时前
下载github patch到本地
git·patch
GDAL14 小时前
Ubuntu下Git使用教程:从入门到实践
linux·git·ubuntu
SaxoZhao14 小时前
Git 使用教程:从入门到精通
前端·git