本地仓库上传至gitee报“fatal: Could not read from remote repository.“

“fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.”

看了stackoverflow上面相关问题之后我知道大概是ssh密钥的问题,所以直接偷懒将远程仓库连接直接换成了https


git remote rm origin
git remote add origin [url]


git remote rm origin 取消链接
git remote add origin [url] 重新连接仓库

问题解决🎇

如果想通过更加合理(直面ssh密钥问题)的解决方式,可以参考stackoverflow相关帖子

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
在Git中,当你从本地仓库到远程仓库时,如果遇到"gitee push fatal: Could not read from remote repository"这个错误,通常是因为你没有正确设置SSH公钥所致。 解决这个问题的步骤如下: 1. 生成对应本地仓库的SSH公钥。 2. 获取对应本地仓库的SSH公钥值。 3. 将得到的SSH公钥复制,添加到远程仓库(gitee)的SSH公钥上。 具体操作步骤如下: 1. 打开终端或命令行界面,输入以下命令生成SSH公钥: ``` ssh-keygen -t rsa -C "your_email@example.com" ``` 注意:将"your_email@example.com"替换为你注册gitee时使用的电子邮件地址。 2. 生成SSH公钥后,可以通过以下命令获取SSH公钥的值: ``` cat ~/.ssh/id_rsa.pub ``` 复制输出的SSH公钥值。 3. 登录到gitee的网站,在头像上方点击进入设置,然后选择"SSH公钥"。 4. 在SSH公钥页面上,点击"添加SSH公钥"按钮,将之前复制的SSH公钥值粘贴到输入框中,并点击"确定"保存。 5. 回到本地仓库的终端或命令行界面,再次运行"git push origin master"命令,应该可以成功上到远程仓库。 通过以上步骤,你应该能够解决"gitee push fatal: Could not read from remote repository"的问题,并成功将本地仓库到gitee远程仓库。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *2* *3* [Gitee:使用ssh提交代码却提示:DeployKey does not support push code fatal: Could not read from remote...](https://blog.csdn.net/weixin_46253682/article/details/125897811)[target="_blank" data-report-click={"spm":"1018.2226.3001.9630","extra":{"utm_source":"vip_chatgpt_common_search_pc_result","utm_medium":"distribute.pc_search_result.none-task-cask-2~all~insert_cask~default-1-null.142^v93^chatsearchT3_2"}}] [.reference_item style="max-width: 100%"] [ .reference_list ]

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值