fatal: ‘origin‘ does not appear to be a git repository fatal: Could not read from remote repository.

6 篇文章 0 订阅

fatal: ‘origin’ does not appear to be a git repository fatal: Could not read from remote repository.

如果在git push时出现了上述情况,或者说Please make sure you have the correct access rights and the repository exists.那么可以尝试两种解决办法

添加ssh公钥,首先查看自己本地的ssh公钥(cat ~/.ssh/id_rsa.pub)将输出的内容复制粘贴到你的github账号的Settings–>SSH and GPG keys然后点击New SSH keys添加你的公钥,title随便起一个就行。

如果在github上已经存在你的本地公钥了,那么你可以先删除远程仓库,然后再利用ssh公钥添加:

git remote remove 你的github名
git remote add origin git@github.com:你的账户名/仓库名.git

然后git push origin master试试

每天一句中文式外语

马来语


汉语	马来语
向上	Naik
向下	Turun
转弯	Belok
右	Kanan
左	Kiri
前	Hadapan
后	Belakang
北	Utara
南	Selatan
东	Timur
西	Barat
上	Atas
下	Bawah
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
当出现错误信息"fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository."时,这通常是由于没有正确关联远程仓库导致的。有两种可能的原因,一种是没有添加关联,另一种是添加的关联有误。以下是解决该问题的步骤: 1. 首先,使用命令"git remote -v"查看当前的远程仓库详细信息,确认是否有正确的仓库名称和关联地址。如果发现远程仓库名称错误,可以使用命令"git remote remove origin"删除错误的远程仓库。 2. 然后,使用命令"git remote add origin 仓库地址"重新添加正确的远程仓库地址。确保仓库地址是正确的,并且与你要提交的代码所在的远程仓库相匹配。 3. 最后,使用命令"git push -u origin master"将代码提交到远程仓库的master分支。确保使用了正确的仓库名称和分支名称进行提交。 通过以上步骤,你应该能够成功解决"fatal: 'origin' does not appear to be a git repository fatal: Could not read from remote repository."的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [git-报错总结-fatal: 'origin' does not appear to be a git repository...](https://blog.csdn.net/vv___/article/details/105744407)[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_1"}}] [.reference_item style="max-width: 50%"] - *2* [fatal: origin does not appear to be a git repository fatal: Could not read from remote repository.](https://blog.csdn.net/Menqq/article/details/128704040)[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_1"}}] [.reference_item style="max-width: 50%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Eugene.Tom.Lee

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

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

余额充值