热门标签 | HotTags
当前位置:  开发笔记 > 编程语言 > 正文

码云拉取代码报错Clonefailedgit@gitee.com:Permissiondenied(publickey).

码云代码拉取失败Clonefailedgitgitee.com:Permissiondenied(publickey).最近入职一家新公司,拉取代码的时候报错&#x

码云代码拉取失败Clone failed git@gitee.com: Permission denied (publickey).

最近入职一家新公司,拉取代码的时候报错,很尴尬,代码拉取都不行,Git的配置又是好好的,一时间不知道啥错误导致的,领导问项目看了没有…捉急。。

折腾了半天,哎。。小问题。

来看下错误吧:

看下仓库地址,有两种协议的 httpsSSH 两种

我用https协议地址的时候报错如下:

error: unable to read askpass response from '/Users/xxx/Library/Caches/Google/AndroidStudio2021.1/tmp/intellij-git-askpass-local.sh' fatal: could not read Username for 'https://gitee.com': Device not configured

用SSH协议的地址时候报错:

Clone failedgit@gitee.com: Permission denied (publickey).Could not read from remote repository.Please make sure you have the correct access rightsand the repository exists.

最后排查问题是因为码云账号的SSH公钥没有设置导致的拉取失败

如图所示
在这里插入图片描述

如果你的账号没有设置,请点击怎样生成公钥,按照上述提示进行配置。

怎样生成公钥

因为之前没怎么用码云,不知道这个细节,-- 配置之后https 协议的地址也可以用了。


推荐阅读
author-avatar
yuliu预留
这个家伙很懒,什么也没留下!
PHP1.CN | 中国最专业的PHP中文社区 | DevBox开发工具箱 | json解析格式化 |PHP资讯 | PHP教程 | 数据库技术 | 服务器技术 | 前端开发技术 | PHP框架 | 开发工具 | 在线工具
Copyright © 1998 - 2020 PHP1.CN. All Rights Reserved | 京公网安备 11010802041100号 | 京ICP备19059560号-4 | PHP1.CN 第一PHP社区 版权所有