git pull时报错fatal: Could not read from remote repository.

git pull 时 报错如下信息:
ssh: Could not resolve hostname https: nodename nor servname provided, or not known
fatal: Could not read from remote repository.

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

这是由于你的git地址采用了ssh方式,切换为https方式即可,也可能是你的仓库地址不对,可以使用如下命令先查看一下:

$ git remote -v

origin    https:YourUserName/YatouTest00123.git (fetch)
origin    https:YourUserName/YatouTest00123.git (push)


你会发现跟你的github地址不一样,登上你的github,找到仓库地址,如图,复制下来:



然后在终端中输入:

$ git remote set-url origin https://github.com/YourUserName/YatouTest00123.git


注:origin后面换成刚刚让你复制的仓库地址。


然后重新 执行 git pull origin master  即可pull成功。


  • 20
    点赞
  • 8
    收藏
    觉得还不错? 一键收藏
  • 7
    评论
fatal: Could not read from remote repository 是一个git pull操作时可能遇到的误。这个误通常表示无法从远程仓库读取。有几种可能的原因和解决方法: 1. 权限问题:你需要确认你是否有访问远程仓库的权限。检查你是否正确配置了SSH密钥,并将公钥添加到你的阿里云效账户中。你可以使用命令ssh-keygen生成SSH密钥对,并将公钥复制到你的阿里云效账户中。 2. 仓库路径问题:请确保你正在使用正确的仓库路径。检查一下你的仓库路径是否设置正确。 3. 仓库不存在问题:如果你确认你有访问权限并且仓库路径正确,那么可能是因为仓库不存在。请确认你正在访问的仓库确实存在。 综上所述,当遇到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* *2* *3* [关于Git使用:fatal: Could not read from remote repository.的报问题解决](https://blog.csdn.net/enjoycpp/article/details/127890929)[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 ]

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值