[git]报错fatal: ‘origin‘ does not appear to be a git repository Could not read from remote repository

问题1:

 

fatal: 'origin' does not appear to be a git repository

fatal: Could not read from remote repository.

说明库是有的,但是没办法push。所以重新关联一下。

解决方法:

输入以下代码,这是因为本地的分支没有和远程分支建立联系,需要执行以下代码就可以正常push

git push --set-upstream origin master

 

问题2:

 

fatal: 'git@github.com/xxx/xx.git' does not appear to be a git reposory

fatal: Could not read from remote repository.

Please make sure you have the correct access rights and the repository exists.

解决方法:

1.检查remote内容

git remote -v      

 

2.删除远程的origin

git remote rm origin

3.检查是否完全删除

git remote -v

4.空了之后重新建立

git remote add origin git@github.com:你的gihub名字/你的仓库名.git

5.检查remote内容

git remote -v

6.最后重新push

git push -u origin master

完成啦!!!!

  • 2
    点赞
  • 20
    收藏
    觉得还不错? 一键收藏
  • 2
    评论
当你在使用git push origin master命令时,出现fatal: 'origin' does not appear to be a git repository的错误提示,这通常是因为你的本地仓库没有与远程仓库进行关联所导致的。解决这个问题的方法有两种: 1. 添加关联:你可以使用命令git remote add origin [远程仓库地址来添加关联,将远程仓库与本地仓库进行关联,例如git remote add origin git@github.com:username/repo.git。然后再次尝试git push origin master命令即可。 2. 重新关联:如果已经添加了关联但仍然出现该错误,可能是关联信息错误导致的。你可以使用命令git remote set-url origin [正确的远程仓库地址来重新设置关联信息,确保所使用的远程仓库地址是正确的。然后再次尝试git push origin master命令。 通过以上方法中的一种,你应该能够解决fatal: 'origin' does not appear to be a git repository的错误提示。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* *3* [git报错:‘origin‘does not appear to be a git repository的解决方法](https://blog.csdn.net/willingtolove/article/details/113187468)[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: 50%"] - *2* [[转]git-报错总结-fatal: ‘origin‘ does not appear to be a git repository](https://blog.csdn.net/weixin_40634003/article/details/122984201)[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: 50%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值