GITHUB 在git clone时出错,提示“Connection reset by ... fatal: Could not read from remote repository."

GITHUB 在git clone时出错,提示“Connection reset by XX.XXX.XXX.XXX port 22. fatal: Could not read from remote repository.”

在从github上clone工程时失败

现象:

  • 使用HTTP的方法,失败提示为:
    “fatal: unable to access
    ‘https://github.com/xxx/xxx.git/’: OpenSSL was built without SSLv3
    support”
  • 使用SSH的方法,失败提示为:
    “Connection reset by XX.XXX.XXX.XXX port 22 fatal:
    Could not read from remote repository.”

失败尝试:

以下是我尝试过无效的方法,但有些情况用了这些方法也许有效,现列出如下:

  • 忽略SSL Verification
    git config http.sslVerify “false”
  • 重新生成 SSH Keys
  • .ssh -p 222 用户名@服务端ip或ssh -l 222 用户名@服务端ip
  • 设置代理
    socks5:
    git config --global http.proxy ‘socks5://127.0.0.1:1080’
    git config --global https.proxy ‘socks5
当克隆仓库出现 "fatal: Could not read from remote repository" 的错误提示,这通常是由于以下几个原因造成的: 1. 权限问题:请确保您对该仓库具有读取权限。检查您的身份验证凭据是否正确,并验证您是否有正确的访问权限。 2. 仓库不存在:确保所克隆的仓库路径正确,并确保该仓库存在于远程服务器上。 3. SSH密钥配置问题:如果您使用SSH进行克隆操作,请确保您已正确配置SSH密钥。您需要在远程服务器上添加公钥,以便进行身份验证。 如果您已经添加了SSH公钥,但仍然遇到问题,可以尝试以下步骤解决: 1. 验证SSH密钥:使用以下命令验证您的SSH密钥是否与您的GitHub或代码托管平台帐户关联: ``` ssh -T git@codeup.aliyun.com ``` 如果命令返回您的用户名,则表示SSH密钥配置正确。否则,请重新配置SSH密钥。 2. 检查远程仓库URL:确保您正在使用正确的远程仓库URL进行克隆操作。您可以在代码托管平台上找到正确的URL。 ``` git remote -v ``` 确认远程仓库URL是否正确,并根据需要进行更正。 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* *3* [【已解决】git clone 报错:Could not read from remote repository. Please make sure you have the ...](https://blog.csdn.net/qq_32682301/article/details/130754765)[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 clone fatal: Could not read from remote repository](https://blog.csdn.net/hzgaoshichao/article/details/124160683)[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 ]
评论 4
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值