Could not resolve hostname http: Name or service not known fatal: Could not read from remote repository.
时间: 2023-10-19 17:01:38 浏览: 95
码云出现错误git@gitee.com: Permission denied (publickey). fatal: Could not read from remote repository. P
5星 · 资源好评率100%
这个错误提示"Could not resolve hostname http: Name or service not known fatal: Could not read from remote repository"通常是由于无法解析主机名导致的。解决这个问题的方法是检查你的配置并确保你输入的主机名正确并且能够被解析。
首先,你可以通过执行以下命令来检查你的配置是否有误:
```
git remote -v
```
这会显示你当前的远程仓库地址。确保你输入的地址是正确的,并且使用的协议是支持的,比如https或者ssh。
如果你的远程仓库地址有误,你可以通过以下命令来更正:
```
git remote rm origin
```
这会移除当前的远程仓库地址。
然后,你可以通过以下命令来新增正确的仓库地址:
```
git remote add origin https://github.com/your-username/your-repository.git
```
请将"https://github.com/your-username/your-repository.git"替换为你实际的仓库地址。
这样,你就可以重新提交你的代码到远程仓库了。希望这个方法能够解决你的问题。<span class="em">1</span><span class="em">2</span><span class="em">3</span>
#### 引用[.reference_title]
- *1* *3* [ssh: Could not resolve hostname https: Name or service not known fatal: Could not read from remote r](https://blog.csdn.net/Amouzy/article/details/126342407)[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* [Could not resolve hostname 。。。。。。: Name or service not known](https://blog.csdn.net/u012965373/article/details/45362991)[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 ]
阅读全文