Git---ssh公钥的配置及使用
绝世唐门三哥:
这个错误表明 Git 无法通过 SSH 连接到远程仓库,主要原因是主机名解析失败。以下是逐步解决方案:
---
### 1. **检查仓库地址是否正确**
- 确保你复制的仓库地址没有拼写错误,特别是主机名部分(如 `github.com`)
- 正确的 SSH 地址格式:
`git@github.com:user/repo.git`
或
`ssh://git@github.com/user/repo.git`
---
### 2. **验证网络连接**
- 尝试 ping 主机名(如 `github.com`):
```bash
ping github.com
```
- 如果无法解析,可能是 DNS 问题。尝试:
- 重启路由器
Git---ssh公钥的配置及使用
绝世唐门三哥:
怎么样了?配好了吗兄弟
Git---ssh公钥的配置及使用
weixin_44147935:
我报这个错该怎么处理:Cloning into 'xxxr'...
ssh: Could not resolve hostname xxx: Name or service not known
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
Git---当本地分支和远程分支都被删除时,如何处理?reflog命令帮你处理
绝世唐门三哥:
我稍后完善下,可以使用这个命令看所有分支的 reflog: git log -g --all
Git---当本地分支和远程分支都被删除时,如何处理?reflog命令帮你处理
绝世唐门三哥:
现在如何了?