git仓库服务器名称变更Could not read from remote repository

一、提交更改时: 
 

git push
GitLab: Project 'vms/core' was moved to 'fms/core'.

Please update your Git remote and try again:

  git remote set-url origin ssh://git@xxxx/fms/core.git
fatal: Could not read from remote repository.

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

 先执行以下:

git remote remove origin
git remote add origin 新仓库地址

查看:

git remote -v

二、关联分支:

error: the requested upstream branch 'origin/master' does not exist

hint: If you are planning on basing your work on an upstream
hint: branch that already exists at the remote, you may need to
hint: run "git fetch" to retrieve it.
hint:
hint: If you are planning to push out a new local branch that
hint: will track its remote counterpart, you may want to use
hint: "git push -u" to set the upstream config as you push.

由于我远程分支已经有了,所以

git fetch

关联即可

git branch --set-upstream-to=origin/master master
git branch --set-upstream-to=origin/develop develop

 

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
当在使用Git时出现"fatal: Could not read from remote repository"的错误,这通常表示Git无法从远程仓库中读取数据。这个问题可能有几种原因导致。 首先,可能是由于网络连接问题导致无法访问远程仓库。请确保你的网络连接正常,并且你能够访问远程仓库的地址。 另外,这个错误也可能是由于权限问题引起的。请确保你有足够的权限来访问远程仓库。你可以向仓库管理员确认你的权限设置是否正确。 此外,还有可能是由于SSH密钥配置问题导致的。如果你使用SSH协议来访问远程仓库,那么请确保你的SSH密钥已正确配置。你可以尝试重新生成和配置SSH密钥,并将公钥添加到你的远程仓库中。 最后,还有可能是由于远程仓库的配置错误导致的。请检查你的仓库配置,确保仓库的URL和认证信息是正确的。 总结起来,解决"fatal: Could not read from remote repository"的问题,你需要检查网络连接、权限、SSH密钥和仓库配置等方面,以确定问题的具体原因,并采取相应的措施来解决。<span class="em">1</span><span class="em">2</span><span class="em">3</span> #### 引用[.reference_title] - *1* [Git解决fatal: Could not read from remote repository.的问题](https://blog.csdn.net/baoyin0822/article/details/122584931)[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^chatgptT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *2* [git 解决 “fatal: Could not read from remote repository.](https://blog.csdn.net/Tristan_csg/article/details/130606751)[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^chatgptT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] - *3* [windows下Idea使用git clone failed. Could not read from remote repository.](https://download.csdn.net/download/weixin_38680506/12923315)[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^chatgptT3_1"}}] [.reference_item style="max-width: 33.333333333333336%"] [ .reference_list ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值