解决“fatal: ‘origin‘ does not appear to be a git repository...”

当使用Git进行代码push提交时,出现报错信息“fatal: 'origin' does not appear to be a git repository...”,

$ git push -u origin master
fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

是因为远程不存在origin这个仓库名称,可以使用如下操作方法,查看远程仓库名称以及路径相关信息,可以删除错误的远程仓库名称,重新添加新的远程仓库;

git remote -v:                                           查看远程仓库详细信息,可以看到仓库名称

git remote remove orign:                        删除orign仓库(如果把origin拼写成orign,删除错误名称仓库)

git remote add origin 仓库地址:              重新添加远程仓库地址

git push -u origin master:                       提交到远程仓库的master主干

当出现错误提示"fatal: 'origin.master' does not appear to be a git repository fatal: Could not read from remote repository."时,这通常是由于本地分支未与远程仓库建立联系导致的。以下是解决该问题的步骤: 1. 确认本地分支已与远程仓库建立联系。可以使用以下命令检查是否已经建立联系:git remote -v。如果没有显示任何输出,表示本地分支尚未与远程仓库建立联系。 2. 如果本地分支尚未与远程仓库建立联系,可以通过以下命令重新关联:git remote add origin [远程仓库地址]。请将[远程仓库地址]替换为你的实际远程仓库地址。 3. 确认关联成功后,再次使用git remote -v命令检查是否已经建立联系。 4. 最后,使用git push命令将本地分支推送到远程仓库:git push -u origin master。 通过以上步骤,你应该能够成功解决"fatal: 'origin.master' 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 fatal: Could not read from remote的...](https://blog.csdn.net/weixin_47872288/article/details/124944945)[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* [[git]报错fatal: ‘origin‘ does not appear to be a git repository Could not read from remote ...](https://blog.csdn.net/m0_56982300/article/details/129473306)[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 ]
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

打赏作者

huayang183

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

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

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

打赏作者

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

抵扣说明:

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

余额充值